How to override default CSS values in a div?

Discussion in 'CSS' started by Abhik, Aug 16, 2009.

  1. #1
    Hello,
    Here goes my div

    <div id="xxx">
    <h3>My Title</h3>
    <ul>
    <li>My Point 1</li>
    <li>My Point 2</li>
    </ul>
    </div>

    now, my question is, how can I set the values of div id "xxx" to override the default css values in my wordpress theme.

    Currently, the h3 tag is set to use 18px Text, But I want to use 10px text for this div only. And, use solid circles as li/ul instead on circle and underline in current CSS.


    Thanks in Advance
    digitech
     
    Abhik, Aug 16, 2009 IP
  2. Rasczak

    Rasczak Peon

    Messages:
    131
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's simple - #xxx {font-size:10px;}
    If you want to style an element with a class, you start with a '.' (dot). If an element has an ID, you start with the hash = '#'.
     
    Rasczak, Aug 16, 2009 IP
    Abhik likes this.
  3. vihutuo

    vihutuo Well-Known Member

    Messages:
    1,511
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    180
    #3
    You would be using something like the following
    
    #xxx
    {
      color : red;
      font-size: 12px;
    }
    
    #xxx h3
    {
        font-size: 10px;
    }
    
    #xxx li
    {
      list-style:disc;
    }
    PHP:
     
    vihutuo, Aug 16, 2009 IP
    Abhik likes this.
  4. Abhik

    Abhik ..:: The ONE ::..

    Messages:
    11,337
    Likes Received:
    606
    Best Answers:
    0
    Trophy Points:
    410
    Digital Goods:
    2
    #4
    Thanks.. That's exactly what I am using right now. :)
     
    Abhik, Aug 17, 2009 IP