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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Top-margin query?

    Hello

    I have a (CSS) container for my table, etc which should be 10px from the top margin:

    Code:
    #container
    
    {
    
    margin:0 auto;
    padding-top:10px;
     width:90%;
    
    }
    Yet when I look at the page layout here:

    http://www.bayingwolf.com/display_recordsTEST.asp

    it certainly looks more than 10px from the top. This is my external style-sheet:

    Code:
    h1
    
    {
    
    color:#3a6d8c;
    font-size:34px;
    line-height:40px;
    margin:0;
    
    }
    
    h3
    
    {
    
    color:#3a6d8c;
    font-size:22px;
    line-height:26px;
    font-weight:normal;
    margin:0 0 8px 0;
    
    }
    
    img {border:0;
    
    }
    
    #logo {margin-bottom:20px; width:300px;
    
    }
    
    #logo h1
    
    {
    
    color:#D91212;
    letter-spacing:-1px;
    font-weight:bold;
    font-family: 'News Cycle', arial, helvetica, sans-serif;
    
    }
    
    #logo h1 span
    
    {
    
    color:#000;
    font-weight:bold;
    font-family: 'News Cycle', arial, helvetica, sans-serif;
    
    }
    
    #logo .title
    
    {
    
    color:#999;
    font-size:12px;
    
    }
    
    #container
    
    {
    
    margin:0 auto;
    padding-top:10px;
     width:90%;
    
    }
    
    table.myTable {width:100%; border:1px}
    
    #content
    
    {
    
    border-bottom:1px dotted #999; 
    border-top:1px dotted #999; 
    padding:20px 0;
    
    }
    is there anything I am not seeing?

    Thanks!

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    Code:
    body {
        margin-top: 50px;
        padding: 0;
    }
    This is pushing everything down...
    Use the W3C HTML Validator and CSS Validator to check your code and Firebug to see what css is applied to an element
    Read Steve Krug's book Don't Make Me Think - essential reading on web usability
    I don't recommend much, but I do recommend Clook for UK web hosting

  • Users who have thanked SB65 for this post:

    SteveH (09-14-2013)

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Oh! Many thanks for that SB65 - I just didn't see it.

    Looks a lot better now.

    I'm grateful.

    Steve


  •  

    Posting Permissions

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