Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Italics in CSS

Status
Not open for further replies.

jj1234

MIS
Jan 27, 2006
46
GB
I would like to style a word in italics but do not know the css how to do this:

<p>Club Amigos!</p>
<p>( Amigos: spanish for friends )</p

I would like to wording: "Amigos - spanish for friends" to be in italics.

Any help would be appreciated.

I know it is: p {font-style: italic; }

But its implementing into the css and html l am unsure as to how to do.
 
Code:
<html>
<head>
   <style type="text/css">
      p.italic {
         font-style: italic;
      }
   </style>
</head>

<body>
   <p>This paragraph is not in italics.</p>
   <p class="italic">This paragraph is in italics.</p>
</body>
</html>

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
If it's simply a style issue/preference then use the CSS as shown.

If that phrase is italicised because of it's meaning or importance then simply mark up the HTML with:

<em>Amigos - Spanish for friends</em>

This denotes emphasis and is different to the old <i> tag which was denoting style.
That way, even browsers and devices that don't/can't/won't show italics can apply emphasis to it in their own way.

The default for this in normal browsers is to show text marked with <em> as italicised. To be safe, add a style rule
Code:
em { font-style:italic; }

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top