W3C home > Mailing lists > Public > www-talk@w3.org > September to October 2012

Creation of CSS pseudo element

From: Ivan Chaer <ivan.chaer@gmail.com>
Date: Fri, 28 Sep 2012 13:34:51 +0200
Message-ID: <CAMh-WpiGH9gBmnJ8by2DmM=tEPx+_V2+a7qiNM1KJRyYhxh8tw@mail.gmail.com>
To: www-talk@w3.org
Hi,

It would be useful to have a CSS pseudo element that wrapped the referenced
element.

With it, we would need less html whenever a single element needs to be
wrapped.


This happens frequently when I have to deal with titles decorated with
lines, like:

Title -------------

or

------ Title ------

So, for example, if we had a pseudo element called, say 'around', I would
need a single element, like:

h1::around {
  display:block;
  background: url('lines.png') center center repeat-x;
  text-align:center;
}

h1 {
  display:inline;
  background: white;
  padding: 0 10px;
}



I searched through the web, and found no smart way to do it, so I am
currently placing a span inside the h1 to achieve this effect.



Many thanks,

Ivan
Received on Friday, 28 September 2012 12:46:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 28 September 2012 12:46:10 GMT