SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    Apr 2003
    Posts
    332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    multiple classes for one element

    How do I use multiple classes for one element? Vinnie answered this question 2 months ago but I can't find the thread.

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,286
    Mentioned
    121 Post(s)
    Tagged
    1 Thread(s)
    something like this?

    <p class="class1 class2 class3">this is some text</p>
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Dave's right

  4. #4
    SitePoint Addict
    Join Date
    Apr 2003
    Posts
    332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't ask the question correctly.

    .aclass {
    color: #660000;
    }
    .bclass {
    font: small Arial, san-serif;
    }
    </style>
    <body>
    <p class="aclass, bclass">Vinnie speaks clearly</p>
    </body>

    Trouble is, my syntax is off. Lead me to Vinnies previous reply and I won't lose the printed copy, this time. The reply included parameters. Thanks.

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Don't separate the class names with commas. You're only supposed to put a space between each class name. Your paragraph should look more like this:
    HTML Code:
    <p class="aclass bclass">Vinnie speaks clearly</p>

  6. #6
    SitePoint Wizard Dangermouse's Avatar
    Join Date
    Oct 2003
    Posts
    1,024
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What browsers dont support multiple classes?

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Dangermouse
    What browsers dont support multiple classes?
    Netscape 4 will ignore them, and IE5/Mac has some trouble with them as well, but since neither browser is under active development it will continue to be a diminishing issue over time.

  8. #8
    SitePoint Addict
    Join Date
    Apr 2003
    Posts
    332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhh! Works well in IE5, thank you again.


Bookmarks

Posting Permissions

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