Page 1 of 1

text background to fit the text

PostPosted: Tue Jan 20, 2004 9:14 am
by ilanphoto
Hi Again
I was wondering whether it is possible to have the background fit the length of the text and not fill the screen.
For example if I want my h2 text of one word to have a black background. I know how to play with margins but then I can't use the same style sheet for another gallery with a longer name

Thanks in advance
Ilan

PostPosted: Tue Jan 20, 2004 11:06 pm
by alangrant
I can't see a way to do this. If you had full control over the page you could wrap the text in a <span> and apply background-color to the span rather than to <h2>. But because it is generated automatically you have no way of inserting the span.

I suppose you could use h2{display:none} to hide the gallery headers completely. Then you could include the title yourself in the Description along with any formatting you like. Not sure if it is worth it though - I haven't checked to see if hiding h2 has any nasty side-effects.