CSS: Text, Fonts, and Tables - Word Wrapping (Page 2 of 6 )
You can remove text wrapping from an element using white-space: nowrap:
<html>
<head>
<style type="text/css">
p
{
white-space: nowrap
}
</style>
</head>
<body>
<p>
Hambone Hambone whats your name? Ask me again and I will tell you the same. You fool! Mr. T pities you greatly! He has decided to auction his multitude of gold chains in order to help raise money to get a girl to date you. I'm not certain it is enough however...
</p>
</body>
</html>
The Font-ain of Youth
Manipulating fonts in CSS is one of the great joys of life. If you are a nerd that is. Otherwise it's just a way to spiffy up your text. And who doesn't want to do that? We'll start off with the simple:
Setting the Font of Your Text with CSS
<html>
<head>
<style type="text/css">
h1 {font-family: impact}
h2 {font-family: verdana}
h3 {font-family: times}
p {font-family: courier}
p.sansserif {font-family: sans-serif}
</style>
</head>
<body>
<h1>Behold the Impact of a corny pun!</h1>
<h2>This is Verdana text</h2>
<h3>And I am his buddy Times!</h3>
<p>Just your friendly Courier here</p>
<p class="sansserif">And I'm loveable sans-serif</p>
</body>
</html>
Setting the Font of A Paragraph
You can use caption to set the font of a paragraph, as in the following example:
<html>
<body>
<p>Behold my paragraph with a normal font</p>
<p style="font: caption">Now behold this one which uses a caption font!</p>
</body>
</html>
Next: Adjusting Your Font Size >>
More Style Sheets Articles
More By James Payne