Maybe this is a workaround
Not knowing specifically what your options are, the following solution may or may not be useful to you. However, I suggest it if it is useful for your situation.
Here is an example script . HTML is the same as yours. I removed the line-height on the span , which, as you said, was not necessary. If you do this, you will need to adjust the height pseudo-element accordingly. This height should roughly correspond to the line-height , which is usually 1.1 or 1.2 , but if set to 500px , it should be height for pseudo-elements.
CSS
#fractal { background-image:url('http://marcomolina.com.br/lab/fractal.jpg'); background-repeat: repeat; width:500px; height:500px; } .centerdotline { position: relative; text-align:center; } .centerdotline span { padding: 0 20px; } .centerdotline span:before, .centerdotline span:after { content: ''; position: absolute; height: 1.2em; width: 40%; background-image:url('http://marcomolina.com.br/lab/dotline.png'); background-repeat: repeat-x; background-position: center; } .centerdotline span:before { left: 0; } .centerdotline span:after{ right: 0; }
source share