Creation of CSS pseudo element

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Creation of CSS pseudo element

Ivan Chaer
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