Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Sep 2008
    Location
    Portland, OR
    Posts
    82
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to Italic individual words

    How do you create a style to italic individual words?

    on this site: www.fatcitycafe.net
    I have words like the Willamette Week, which is a publication that I want to italicize.

  • #2
    Regular Coder
    Join Date
    Oct 2008
    Posts
    130
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Code:
    <style type="text/css">
    
    .i {  font-style:italic
    
    }
    
    </style>
    
    <p class="i">Text</p>
    Add class="i" for each word you want to italicize.



    A simpler solution, however, would be to add <i> tags around text.

    Code:
    <i>Text</i>
    Last edited by GardenGnome2; 11-18-2008 at 01:28 AM.

  • #3
    New Coder
    Join Date
    Sep 2008
    Location
    Portland, OR
    Posts
    82
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I didn't know that <i> tags were still used. That did the trick.
    Last edited by vinoman2; 11-18-2008 at 02:28 AM.

  • #4
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Use the structural tag em instead of the formatting tag <i>:
    Code:
    <em>I'm italized and at the same time, and I receive a special attention from the spiders</em>
    For further reading:
    http://www.netmechanic.com/news/vol6/html_no12.htm
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #5
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    If it is a "citation", <cite> might also work to do that, depending on the semantics involved.
    http://dev.opera.com/articles/view/2...nts/#citations


    Or use a <span class="some_class" > </span> and set the styles as per #2 above for the .some_class
    Last edited by jlhaslip; 11-18-2008 at 04:23 AM. Reason: add link


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •