Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcing headings to wrap in html

Tags:

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?

like image 480
froadie Avatar asked Dec 16 '09 19:12

froadie


People also ask

How do you force text wrap in HTML?

You can force long (unbroken) text to wrap in a new line by specifying break-word with the word-wrap property. For example, you can use it to prevent text extending out the box and breaking the layout. This commonly happens when you have a long URL in the sidebar or comment list.

How do you wrap a header in HTML?

It should have the combination of two: word-wrap: break-word; white-space: normal; thanks to Tor and Alex :) Show activity on this post.


2 Answers

word-wrap:break-word;
like image 125
Tor Valamo Avatar answered Sep 20 '22 18:09

Tor Valamo


It should have the combination of two:

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

thanks to Tor and Alex :)

like image 35
justnajm Avatar answered Sep 19 '22 18:09

justnajm