May a Tag have Two Classes?

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

    May a Tag have Two Classes?

    I recently got a warning from the WDG HTML Validator at
    http://www.htmlhelp.com/ for assigning two classes as shown for
    http://www.journeys.ws/books.asp :

    Line 71, character 23:

    <p class="menu" class="nw">

    Error: duplicate specification of attribute CLASS

    I Googled but can't find anything on it. Is there a way to assign two
    classes so the page will validate (yes, I know there are other errors and
    I'm working on them)?

    TIA

    Neill

    --
    Wayfarer
    Journeys: http://www.journeys.ws/

    There is a difference between knowing the path and walking the path. -
    Morpheus


  • Steve Pugh

    #2
    Re: May a Tag have Two Classes?

    "Wayfarer" <wfping2004-x@yahoo.com> wrote:
    [color=blue]
    >I recently got a warning from the WDG HTML Validator at
    >http://www.htmlhelp.com/ for assigning two classes as shown for
    >http://www.journeys.ws/books.asp :
    >
    >Line 71, character 23:
    >
    ><p class="menu" class="nw">
    >
    >Error: duplicate specification of attribute CLASS
    >
    >I Googled but can't find anything on it. Is there a way to assign two
    >classes so the page will validate (yes, I know there are other errors and
    >I'm working on them)?[/color]

    Yes. Multiple classes are space separated e.g. <p class="menu nw">

    Neither class will be applied by Netscape 4, but both will be applied
    by IE5 (maybe IE4) and more modern browsers.

    Steve

    Comment

    • Michael Winter

      #3
      Re: May a Tag have Two Classes?

      On Mon, 10 Jan 2005 17:23:21 +0000, Steve Pugh <steve@pugh.net > wrote:
      [color=blue]
      > [...] both [classes] will be applied by IE5 (maybe IE4) [...][/color]

      IE4 doesn't support multiple classes.

      Mike

      --
      Michael Winter
      Replace ".invalid" with ".uk" to reply by e-mail.

      Comment

      • Steve Pugh

        #4
        Re: May a Tag have Two Classes?

        "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote:
        [color=blue]
        >On Mon, 10 Jan 2005 17:23:21 +0000, Steve Pugh <steve@pugh.net > wrote:
        >[color=green]
        >> [...] both [classes] will be applied by IE5 (maybe IE4) [...][/color]
        >
        >IE4 doesn't support multiple classes.[/color]

        There we are then. Another benefit to using multiple classes - it
        hides our CSS from IE4 as well as from NN4. Good stuff.

        Steve

        Comment

        • Andreas Prilop

          #5
          Re: May a Tag have Two Classes?

          On Tue, 11 Jan 2005, Steve Pugh wrote:
          [color=blue][color=green]
          >> IE4 doesn't support multiple classes.[/color]
          >
          > There we are then. Another benefit to using multiple classes - it
          > hides our CSS from IE4 as well as from NN4. Good stuff.[/color]

          You don't even need multiple classes: just write
          <p class="mystyle mystyle">

          --
          Top-posting.
          What's the most irritating thing on Usenet?

          Comment

          Working...