#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    India
    Posts
    20
    Rep Power
    0

    problem with the ID selector in CSS


    Hello friends

    How can i define a css rule with an ID selector for two or more different ID's for an <div> element

    thanks
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    city of sin, state of the art
    Posts
    421
    Rep Power
    0
    for IDs use the #class1 instead of the .class1

    "I hate quotations."
    -ralph waldo emerson-
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    India
    Posts
    20
    Rep Power
    0

    Thanks a lot


    Originally Posted by cliffhanger9
    for IDs use the #class1 instead of the .class1

    Hi cliff

    thanks a lot for ur reply. I know how to define an id selector css rule But my problem is that a want to define a single rule for various ids

    for example

    <div id="a">
    .....some html
    </div>
    <div id="b">
    .....some html
    </div>
    <div id="c">
    .....some html
    </div>

    Now i want to define a common css rule for all the above <div> element ids i.e. a,b and c

    thanks
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    city of sin, state of the art
    Posts
    421
    Rep Power
    0
    oh okay

    sorry about that

    try something like this...using commas..

    Code:
    #a, #b, #c {
     background-color:red;
    }
    that should apply the red background color to each element where id is either a, b, or c

    is that what you meant?

    hope this helps!

    "I hate quotations."
    -ralph waldo emerson-
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    India
    Posts
    20
    Rep Power
    0

    A Big thakhs


    Originally Posted by cliffhanger9
    oh okay

    sorry about that

    try something like this...using commas..

    Code:
    #a, #b, #c {
     background-color:red;
    }
    that should apply the red background color to each element where id is either a, b, or c

    is that what you meant?

    hope this helps!

    Thanks It Works!!!!!!!!!!!!!!!
    Cheers for cliff

IMN logo majestic logo threadwatch logo seochat tools logo