22

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?

Kara
  • 6,115
  • 16
  • 50
  • 57
froadie
  • 221
  • 1
  • 2
  • 3

5 Answers5

26
word-wrap:break-word;
Tor Valamo
  • 33,261
  • 11
  • 73
  • 81
16

It should have the combination of two:

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

thanks to Tor and Alex :)

justnajm
  • 4,422
  • 6
  • 36
  • 56
8

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.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
1

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;"
Sonny Boy
  • 7,848
  • 18
  • 76
  • 104
1

the h1 tag has a zero line height

style="line-height:100%;"
MBehtemam
  • 7,865
  • 15
  • 66
  • 108
Fabio
  • 11
  • 1