Tiny alignment issue - REALLY annoying!

Discussion in 'HTML & Website Design' started by tomah, Feb 28, 2007.

  1. #1
    OK. At the top of my blog you'll see a row of links. I want them left aligned to the same place as the search bar in the header.

    The problem is that it looks fine on my screen, but if I open up the favourites to narrow the screen, it goes too far right.

    I imagine that different sizes of screens give different results too.

    My CSS looks like this -

    .nav {
    	position: relative;
            left: 250px;
    	top: 5px;
    	height: 5px; /* Is this necessary? */
    	/* font: 1.2em Verdana, Sans-Serif; */
    	font-size: 1.2em;
            font-weight: bold;
    	color: #404040; /* Is this necessary? */
    	}
    
    .nav a {
    	color: #a2b3bf;
    	}
    Code (markup):
    Can anyone help?
     
    tomah, Feb 28, 2007 IP
  2. unitedrokz

    unitedrokz Peon

    Messages:
    86
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    replace
    left:250px;

    with
    margin-left:auto;
    margin-right:auto;

    that should work but if it doesnt, either way its the left:250px that causing your problem so you will need to replace that with something else.
     
    unitedrokz, Feb 28, 2007 IP
  3. tomah

    tomah Peon

    Messages:
    143
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I already tried that - doesn't work :(
     
    tomah, Feb 28, 2007 IP
  4. unitedrokz

    unitedrokz Peon

    Messages:
    86
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    sorry i didnt notice before but the its not working because you havent defined a specific width for the nav div.

    width:750px; /* whatever width you choose */
    margin-left:auto;
    margin-right:auto;
     
    unitedrokz, Feb 28, 2007 IP
  5. tomah

    tomah Peon

    Messages:
    143
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Top job! Thank you SOOO much!

    I added to you your rep.
     
    tomah, Feb 28, 2007 IP
  6. unitedrokz

    unitedrokz Peon

    Messages:
    86
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6
    no problems - glad i could help
     
    unitedrokz, Feb 28, 2007 IP