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?
Forcing headings to wrap in html
Asked Answered
Can you post some example code that we look at to get a better idea of the problem? –
Cabernet
word-wrap:break-word;
make sure it is also white-space:normal –
Gilbertegilbertian
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;"
No, it's not within another element –
Initiative
the h1
tag has a zero line height
style="line-height:100%;"
This does not answer the question at all. It is not even related to the question. –
Eggnog
© 2022 - 2024 — McMap. All rights reserved.