Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

HTML header problem

Options
  • 13-08-2012 8:22pm
    #1
    Registered Users Posts: 1,551 ✭✭✭


    Hi I'm trying to create a basic webpage using html and css.
    I have created a basic header bar using a red background and blue text but the problem is when I use a heading for the text ie. h1 there is a white space left above the bar.
    Whats the best way of getting rid of the space above the bar?
    I want it to look the same in all the browsers.


Comments

  • Closed Accounts Posts: 2,663 ✭✭✭Cork24


    Can you post your Code?

    More Likely you have the CSS colour System all fecked up.



    #header h1 a{
    font-weight:100;
    color: blue;
    text-decoration: none;
    }


  • Registered Users Posts: 25 Marty_McFly


    Lob into this yolk :)

    http://jsfiddle.net/


  • Registered Users Posts: 1,551 ✭✭✭quinnd6


    #header
    {
    
    margin-top:0;
    padding-top:0;
    background-color:red;
    text-align:center;
    color:blue;
    }
    
    body
    {
    margin:0;
    padding:0;
    
    }
    


  • Closed Accounts Posts: 2,663 ✭✭✭Cork24


    quinnd6 wrote: »
    #header
    {
    
    margin-top:0;
    padding-top:0;
    background-color:red;
    text-align:center;
    color:blue;
    }
    
    body
    {
    margin:0;
    padding:0;
    
    }
    

    Your Back Ground Color should be in the Body, or in the CSS of your DIV.


  • Registered Users Posts: 1,551 ✭✭✭quinnd6


    It's in the css of my header div though isn't it.
    I haven't decided on the background color for the body yet.
    So its just white at the moment.
    I read somewhere about using padding with negative numbers.
    Would that be a bad idea?


  • Advertisement
  • Closed Accounts Posts: 2,663 ✭✭✭Cork24


    By all means you could Use a Table as your layout



    <div id="Header" name="Header" title="This is my Header" style="color:Red;
    font: Helvetica 12pt;border: 1px solid black;">
    <h1>Header</h1>
    </div>


    http://www.w3schools.com/ This site gives you every thing you need to know.

    i would Say to you is Download Some Website Demos see what you like in each site and try and take all the parts you like in each Demo Site and place them into your Basic Webpage..
    Alot of Companys use the Same layout all the time, just change it around to meet the clients Needs.


  • Registered Users Posts: 1,551 ✭✭✭quinnd6


    Yep I think the problem was I wasn't using float:left.
    Using float:left fixed it anyway for me.


Advertisement