CSS inherit problem

Discussion in 'HTML & Website Design' started by wesley.bunton, Feb 22, 2009.

  1. #1
    I am having a very odd problem with a css file i'm using. I have a body style in my .css file that looks like this:

    body{
    padding-left: 11em;
    font-family: segoe script, "Times New Roman", Times, serif;
    font-size: 150%;
    color: #AFEAAA;
    background-color: #51A5BA }

    As you can see I have a left padding in the entire page. But I have an address tag at the bottom of all of my pages that I do not want to inherit this 11em.

    So at first I made a new section in my css file, just for the address tag:

    address {
    padding-left:0em;
    font-size: 13px;
    }

    This doesn't work for some reason. At first I thought that it wasn't working because I had screwed up this entire address block. But thats not true because I can change the font size and the change works. So it is linking correctly to the right tag, but the 0em will not override the body section.

    So I tried to do in inline, with some !important tag that I found online, and this didn't work either.

    <address style="padding-left:0px !important;">By Me</address>

    I hope that I have explained this well enough. Does anyone have any idea why this wouldn't work? Any help is appreciated.

    Wes
     
    wesley.bunton, Feb 22, 2009 IP
  2. camp185

    camp185 Well-Known Member

    Messages:
    1,653
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    180
    #2
    It's because it still thinks it's within the body. Try -11em.
     
    camp185, Feb 23, 2009 IP
  3. wesley.bunton

    wesley.bunton Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    That doesn't seem to work either. I've also tried some different values other than 0 as well. I've tried 4, 10, 100, etc. Nothing seems to work in this line.

    Thanks for the suggestion though, any others?
     
    wesley.bunton, Feb 23, 2009 IP
  4. Lpe04

    Lpe04 Peon

    Messages:
    579
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Take out the !important part and try it. I think if you style it in the html (without the !important thing) it will override the style sheet, at least in FF. Take care.

    If that doesn't work, try moving the address above the body in the stylesheet (just a guess).
     
    Lpe04, Feb 23, 2009 IP
  5. Lpe04

    Lpe04 Peon

    Messages:
    579
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can also try creating a seperate id or class for this like

    #addressbott{padding-left:0em}

    <address id="addressbott">Whatever</address>
     
    Lpe04, Feb 23, 2009 IP
  6. wesley.bunton

    wesley.bunton Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #6
    I already took out the !important attribute, since I have never heard of it, plus it didn't work, haha. I also tried to put the address tag above the body in the stylesheet, and I've tried to make an "in file" style in the header, just for that address tag, and none of that works.

    It's so weird! Thanks so much though for the suggestion!
     
    wesley.bunton, Feb 23, 2009 IP
  7. wesley.bunton

    wesley.bunton Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    I tried that just now. I made it <address id="myaddress">, and made the css file the same. Still doesn't work.

    This is just too weird, it should be a simple thing.

    I also wanted to note that I've been getting the same thing in not only FF but also IE.
     
    wesley.bunton, Feb 23, 2009 IP
  8. Lpe04

    Lpe04 Peon

    Messages:
    579
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #8
    When you refresh the page, try hitting ctrl+F5, that should force a fresh cache of the stylesheet, you might be getting the same one in your browser everytime.
     
    Lpe04, Feb 23, 2009 IP
  9. Lpe04

    Lpe04 Peon

    Messages:
    579
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Can you give me the web address, I'll mess with it real quick
     
    Lpe04, Feb 23, 2009 IP
  10. wesley.bunton

    wesley.bunton Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #10
    Sorry about the delay. The url is:

    www.weddingofwesandtheresa.com

    Thanks so much for all the advice.
     
    wesley.bunton, Feb 25, 2009 IP
  11. wesley.bunton

    wesley.bunton Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #11
    Also, here is the url for my css file:

    weddingofwesandtheresa.com/Scripts/weddingstyle.css
     
    wesley.bunton, Feb 25, 2009 IP
  12. wesley.bunton

    wesley.bunton Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #12
    I ended up fixing this. I went a head and remodeled my whole css file. And I ended up using a combination of:

    text-align: center;
    margin-left: auto;
    margin-right: auto;

    And that seemed to help it. I needed to clean up my code anyways. Thanks so much guys for your help.
     
    wesley.bunton, Feb 27, 2009 IP