Board index PBase HTML and Style Sheets text background to fit the text

HTML and Style Sheets

text background to fit the text

Customize your galleries.
ilanphoto
 
Posts: 876

text background to fit the text

Post Tue Jan 20, 2004 9:14 am


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

alangrant
 
Posts: 861


Post Tue Jan 20, 2004 11:06 pm


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.
Alan
Travel Photos - http://www.pbase.com/alangrant
Balkanology: Explore Southeast Europe - http://www.balkanology.com/


Board index PBase HTML and Style Sheets text background to fit the text

Who is online

Users browsing this forum: ClaudeBot and 2 guests