Results 1 to 5 of 5

Thread: CSS: merging classes

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350

    CSS: merging classes

    Hi, I think the question is simple:
    Code:
    <style>
     p.R = {color: red}
     p.U = {font-deco: underline}
    </style>
    
    ...
    
    <p class=R class=U> red & underline text wanted </p>
    IE takes only the first class. How to specify, or how to write style, which will be the summary of all particular styles?

  2. #2
    Lively Member
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    96
    add it to you stylesheet..

    <style>
    p.R = {color: red}
    p.U = {font-deco: underline}
    p.RU = {font-deco: underline; color: red}
    </style>

    it's the correct way to do it..
    http://www.raketje.com coming..............soon................

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350
    Yes, that's what I've had. When R and U are the case, it works fine. But this begins to be quite ineffective since the combinations of all used 'letters'.
    I used this sample to illustrate the problem, in fact I have about six such 'letters', which together gives 6!=720 possibilites.

    I don't find usefull to write all these cases, of course; I'm sorry, but is there any other solution...?

  4. #4
    Lively Member
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    96
    http://www.raketje.com coming..............soon................

  5. #5
    Lively Member
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    96
    I guess you have to build the necessery stylesheet when you load the page.

    you can do this using javascript, php, asp

    needed stylesheet =
    <style>
    p.needed = {color: red; font-deco: underline}

    let a script add the stuff you need.
    http://www.raketje.com coming..............soon................

Posting Permissions

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



Click Here to Expand Forum to Full Width