CSS inline italics ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • prt7u

    #1

    CSS inline italics ?

    Howdy,

    I'm new to CSS and have a basic question. What is the best way to
    italicize a word or words using CSS versus the <em</emtags that
    used to be used in HTML?

    Or am I jumping the gun and assuming that there is a better way with
    CSS versus the HTML tags?

    Does it make sense to do them "inline" or set up a class or some other
    such thing and then reference that to make it do what I want?

    Thanks in advance for the help and the patience,

    Pete

  • Els

    #2
    Re: CSS inline italics ?

    prt7u wrote:
    Howdy,
    >
    I'm new to CSS and have a basic question. What is the best way to
    italicize a word or words using CSS versus the <em</emtags that
    used to be used in HTML?
    >
    Or am I jumping the gun and assuming that there is a better way with
    CSS versus the HTML tags?
    >
    Does it make sense to do them "inline" or set up a class or some other
    such thing and then reference that to make it do what I want?
    It depends on the reason to italicize the text. If the reason is that
    you want to emphasize it, use <em></em>. If it's a 'strong' word ;-),
    use <strong></strong>. If it is just random decoration for no
    particular reason, use <i></i>. If it's just decoration and you may
    want it italic now, but bold red in the future, use <span
    class="foo"></span>, where foo should be something that tells you
    what's so special about that particular text that you want it italic
    now, but maybe bold red on another day.

    Each of these elements can be styled through CSS, so even if you do
    decide to use <i></i>, you can still change it later:
    i{font-style:normal;fo nt-color:red;font-weight:bold;}

    --
    Els http://locusmeus.com/
    accessible web design: http://locusoptimus.com/

    Comment

    • Andreas Prilop

      #3
      Re: CSS inline italics ?

      On Thu, 22 Mar 2007, prt7u wrote:
      What is the best way to italicize a word or words
      <i>word or words</i>
      using CSS
      i { font-style: italic } /* redundant */
      versus the <em</emtags that used to be used in HTML?
      <emis emphasis, not italics - and it's still "used",
      not "used to be used", for this purpose.

      --
      In memoriam Alan J. Flavell

      Comment

      • Jukka K. Korpela

        #4
        Re: CSS inline italics ?

        Scripsit Els:
        It depends on the reason to italicize the text. If the reason is that
        you want to emphasize it, use <em></em>. If it's a 'strong' word ;-),
        use <strong></strong>. If it is just random decoration for no
        particular reason, use <i></i>. If it's just decoration and you may
        want it italic now, but bold red in the future, use <span
        class="foo"></span>, where foo should be something that tells you
        what's so special about that particular text that you want it italic
        now, but maybe bold red on another day.
        For completeness - though this is a markup matter rather than CSS - I might
        add that you can use <citefor a book title or something similar and <var>
        for a placeholder or variable. IE also displays <addressin italics by
        default, which is just foolish in most situations; fix it with address {
        font-style: normal } if you use <address>.

        All of these methods actually produce either italics or oblique, depending
        on font. Although CSS distinguishes between font-style: italic and
        font-style: oblique, browsers don't. Whichever method you use, you get
        either real italics (italic font style as designed by a typographer) or
        oblique, i.e. algorithmically slanted text. You get the latter if the font
        has no italic version (available on the user's computer). It gives poor
        typographic quality in general, but for some special characters it's really
        awful. If you have Arial Unicode MS on your system (you probably have it if
        you have MS Office software), testing
        <div style="font-family: Arial Unicode MS; font-style:
        italic">Hello|\ world!</div
        is illustrating.

        --
        Jukka K. Korpela ("Yucca")


        Comment

        Working...