Hi,
I don't know many words that are this long i.e. "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
You have to treat unbroken text much the same as if you had put an image in that section that is 600px wide. i.e. just don't do it . If it was a dynamic environment where you had no control you should be trapping input anyway and truncating as you go.
However, these days you can use "word-wrap:break-word;" to break unbroken text at the boundaries as the modern browsers now support it
Code:
#wrapper {
background-color:#fff;
width:960px;
margin:0 auto;
word-wrap:break-word;
}
It was previously proprietary IE only code but has now been incorporated into the specs and supported in the latest browsers versions.
A couple of pointers in your code:
Don't add divs where none are needed.
e.g.
Code:
<div id="nav">
<ul>
<li><a href="#">home</a></li>
<li><a href="#">tutorials</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
The div is superluous unless you have multiple backgrounds being applied.
The ul is a perfect container.
Code:
<ul id="nav">
<li><a href="#">home</a></li>
<li><a href="#">tutorials</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
Don't use empty clearers.
Code:
<div class="clear"></div>
Most of the time they are not needed as you could simply have set the footer to clear:both in your example anyway. For the nav you should contain the floats using a mechanism that doesn't need structural markup such as using overflow:hidden on the ul where visible overflow is not required or alternatively the
revised clearfix method.
Bookmarks