Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2008
    Location
    India, Banglore
    Posts
    50
    Thanks
    1
    Thanked 0 Times in 0 Posts

    how do I declare two classes in css

    I have two classes in HTML ex; <div class="portlet events"></div>
    I want to declare the in css in one line rather than two different classes like this .portlet{}
    .events{}

    can I put like this ex; .portlet.odd{} ????

    If I give these classes like the first ex; in css then these effect for other pages also since they are given individual class. so I want to use both class in one line for one style only!!!!


    Any one to help

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Code:
    .portlet , .events{
    
    }
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by ksanjanadevi View Post
    I have two classes in HTML ex; <div class="portlet events"></div>
    I want to declare the in css in one line rather than two different classes like this .portlet{}
    .events{}

    can I put like this ex; .portlet.odd{} ????

    If I give these classes like the first ex; in css then these effect for other pages also since they are given individual class. so I want to use both class in one line for one style only!!!!


    Any one to help
    Yes you can use classname1.classname2 however IE6 support may be a little buggy. I can't remember.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    Regular Coder Doctor_Varney's Avatar
    Join Date
    Mar 2008
    Location
    Midlands, UK
    Posts
    649
    Thanks
    45
    Thanked 29 Times in 28 Posts
    Seperated by:

    A comma in the CSS and...
    A space in the HTML.

    Definition: Computer rage is a heightened physiological response with associated feelings of anger and frustration[1] resulting from using a computer or other complex electronic device. It may result in the physical assault of the computer or similar item.[2] Computer use often leads to verbal abuse and occasionally physical violence towards the object.[3] Computer rage may be caused by distress due to a hardware or software problem which the enraged person is unable to correct.


  •  

    Posting Permissions

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