SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Zealot pony's Avatar
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    multiple classes

    Right now I don't have the capability to test this out for myself so yer help would be much appreciated.
    I've been using more than one class applied to the same tag like this

    <p class="firstclass secondclass thirdclass">

    And this seems to be fine in IE5. Does anyone know if any other browsers have a problem with this? I've noticed that Dreamweaver's interface doesn't allow for it.
    the bottoms of my shoes are clean from walking in the rain

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May I ask why you are doing this? To be honest, that really shouldn't work.

    It would be much simpler AND more effective for other browsers if you simply complied those 3 styles into one.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Zealot pony's Avatar
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It does seem to work in IE5.
    The reason I've started doing it is that it allows me to create fewer styles that can be employed in different combinations to get the results I want.
    For example I may want a class that specifies a particular font. I may then want that font to appear in two or three different percentage sizes.
    Using this method I don't have to specify the font in the size classes. I can then use these size classes elsewhere.

    Have you tested it in any other browsers?

    The w3c html validator doesn't seem to be worried by it when I validate the pages as XHTML transitional.
    Does the validator cover the implementation of CSS classes. It may just presume that 'firstclass secondclass thirdclass' is the name of a single class. Mind you aren't spaces illegal in when naming classes?

    My gut feeling was that it shouldn't work but I'm struggling to find evidence to the contrary.
    the bottoms of my shoes are clean from walking in the rain

  4. #4
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eh -- I believe it's a lost cause. If, by some chance, the w3c validator is telling you it is all right -- it is thinking it's one class I think. However, wouldn't it catch that when it scanned the styles at the top (or whereever they're located) and didn't find it? You can keep looking, but I believe it would be easier to just specify different classes. It might be easier in the long run anyway if you're planning on using the same ones throughout your site....
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  5. #5
    SitePoint Zealot pony's Avatar
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found the following on the w3C's REC-CSS2. It proves that what I'm doing is valid, if only by inference:

    "For example, the following rule matches any P element whose "class" attribute has been assigned a list of space-separated values that includes "pastoral" and "marine":


    P.pastoral.marine { color: green }

    This rule matches when class="pastoral blue aqua marine" but does not match for class="pastoral blue". "

    Who'd've thunk it?
    the bottoms of my shoes are clean from walking in the rain


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
  •