positioning a div

Associate
Joined
10 Feb 2009
Posts
1,894
Location
Leicester
Im trying to position my navbar inline with the text in my document but im having a hard time with it.

its current position is red and i want it to be where blue is

http://i.cubeupload.com/H1tjBG.jpg

code:

http://jsfiddle.net/z4XKK/

can anyone help?

cheers

i managed to get it there but when resizing the window it wouldn't move and on my tablet it stretched out the website, ive tried absolute, fixed and relative positioning.
 
Thanks, managed to fix it by using float, I was wondering what is the best way to position text inside a div? I want my text left aligned but close to the center of my homepage
 
Use a div or other container element with a set width ( can be a percentage of parent width ) and both margin-left and margin-right set to auto.

p{
width:50%;
margin:0 auto;
text-align:left;
}
 
Back
Top Bottom