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
    New Coder
    Join Date
    Nov 2008
    Posts
    21
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Header Align Issue

    Hi.

    Sorry if this has been asked a million times.

    I am using CSS to make a layout and all is fine so far. However I cant seem to align my header.

    here is my code.

    #header{
    width: 618px;
    height: 100px;
    background-color:#FFFFFF;
    border-size: 4px;
    border-color:#000000;
    border-style: solid;
    }

    I had tried several methods to align including the float attribute which works fine for right and left. I tried absolute for center but no luck. I also tried just " position: center; ' with no luck.
    Only way I found was to use the <center> tags over my <div id> This worked but I want my style sheet to align my header.

    I cant see where I am going wrong. Hope somebody here can help.

    Thank you

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,739
    Thanks
    22
    Thanked 1,836 Times in 1,820 Posts
    Hello neonflorida,
    Are you trying to center it? Try this:
    Code:
    #header{
    margin: 0 auto;
    width: 618px;
    height: 100px;
    background: #FFFFFF;
    border: 4px solid #000000;}
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Nov 2008
    Posts
    21
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thank you very much,, it worked.


  •  

    Posting Permissions

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