Help with DIV Styles

Discussion in 'CSS' started by mikemalphurs, Mar 4, 2008.

  1. #1
    Hello-
    I have a CSS text mark-up issue I could use some help with. I have a Div Tag that has a "p" tag applied to it. Whnever I try to create an additional class to use for th ep tag within that DIV, it does not "take". Is there anyway to have a Class over-ride the P tag applied to the DIV?

    Here is the DIV:
    
    <div class="InteriorText">
    <p>When it comes to technology, have you ever noticed that there is always something that someone doesn't want you to buy?</p></div>
    
    Code (markup):
    Here is the DIV's CSS:
    
    .InteriorText p{
    color: #666666;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8em;
    }
    
    Code (markup):
    Here is the class I would like to apply to certain P tags within the same DIV, but is being "overridden" by the above CSS:

    
    .ContentSubHead {
    font-size: 2.0em;
    font-weight: bold;
    }
    
    Code (markup):
    And finally, the HTML code snippet:
    
    <div class="InteriorText">
    <p class="_ContentSubHead">When it comes to technology, have you ever noticed that    there is always something that someone doesn't want you to buy? </p></div>
    
    Code (markup):
    Any help would be greatly appreciated... Thanks!
     
    mikemalphurs, Mar 4, 2008 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    <p class="_ContentSubHead"> change to
    <p class="ContentSubHead">
    and it works.
     
    shallowink, Mar 4, 2008 IP
  3. mikemalphurs

    mikemalphurs Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hmm.. Still getting the same thing. Here's the new code:
    
    <div class="InteriorText">
    <p class="ContentSubHead">When it comes to technology, have you ever noticed that there is always something that someone doesn't want you to buy? </p></div>
    
    Code (markup):
    
    .ContentSubHead {
    	font-size: 2em;
    	font-weight: bold;
    }
    
    Code (markup):
    And here is the screenshot:
    [​IMG]
     
    mikemalphurs, Mar 4, 2008 IP
  4. mikemalphurs

    mikemalphurs Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It still has the DIV's p tag style applied to the header and subhead, instead of the ".ContentSubhead" class.

    Any ideas? Thanks for your help.
     
    mikemalphurs, Mar 4, 2008 IP
  5. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #5
    shallowink, Mar 4, 2008 IP