Forcing headings to wrap in html

Viewed 43780

I have a web page that displays a pdf document. In the header there is an image and an h1 tag that contains a name. When the name is too long, it gets cut off. How can I force it to wrap to the next line instead so that the entire name is displayed? I tried inserting a style="white-space:normal" but it doesn't help. Any suggestions?

5 Answers

It should have the combination of two:

word-wrap: break-word;
white-space: normal;

thanks to Tor and Alex :)

h1 tags wrap by default. If they're not, something in your CSS is overriding that default behaviour. If you can post a link to the site, we can quickly help you out. You might want to consider installing Firebug for Firefox - it'll let you right-click on the h1 and view what styles are being applied to it, and from where they come.

Is the header contained wihtin another element such as a div? If so, check the overflow for that element and/or try setting it to visible like this:

style="overflow:visible;"

the h1 tag has a zero line height

style="line-height:100%;"
Related