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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts

    question: padding:0; margin:0 ?

    Hi All,

    This is driving me a bit nutty.

    I have this container here:

    My Container Here

    Now as you can see the middle is off centre. Now I can fix this by adding:

    Code:
    * { padding:0; margin:0; }
    To the code, but I ONLY want this on the #holder element. So is there any way I can:

    1) get the #holder element to do this as adding the above effects all the other elements on my page, which I don't want?

    2) Or Add some different code that would fix this problem?

    I tried:

    Code:
    #holder {
     width:170px; height: 295px; background:#fff
     padding: 0;
     margin:0;
    }
    But that does not work

    Thanks

    Chris
    Last edited by stfc_boy; 06-08-2009 at 12:05 PM.

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Missing semi-colon after your background element I think:

    Code:
    #holder {
     width:170px; height: 295px; background:#fff;
     padding: 0;
     margin:0;
    }

  • #3
    New Coder
    Join Date
    Mar 2009
    Location
    Milton Keynes, England
    Posts
    54
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Adding margin: 0;, to the following in your css:

    #holder h3.inline-header

    #holder ul

    #holder p.inline-footer

    This fixes it, but not sure if its the best method to do so.

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts
    Thanks, but that's just a typo, does not effect the code.

    My Container here

    Any other ideas anyone?

    Thanks

  • #5
    New Coder
    Join Date
    Mar 2009
    Location
    Milton Keynes, England
    Posts
    54
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Code:
    #holder p.inline-footer {
     padding:10px 12px 0px 12px; height:28px;
     background: #c11b17 url('http://www.inspireaway.co.uk/container/footer.jpg') no-repeat;
     color:#fff; text-align:left; font-size:90%;
     margin:0;
    }
    If you are wondering, the footer isn't working because of a missed ;


  •  

    Posting Permissions

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