If you take a look at the picture i have supplied above i have a header image where the navigation needs to be on the white area i have marked. For this to work i use the position:absolute; attribute but when the header image centers it just stays there. Also it cant move away from that white area. With tabledesign i could put 1 td on each side to prevent the content to move away from the table.
Now if you watch the bottom bar there the links needs to be inside that and still be centered along with the header when you resize it. You will understand when you check the site out.
you need to put the #navigation div inside the #header div and apply 'position: relative;' to the #header div so the #navigation div will be absolutely positioned within the #header div
I looked at your code, and messed a little bit with it to fix it. Dont know if this is what you are looking for.
I uploaded the changes to here:
www.c-styled.com/test/
you can click the nipponfix.php to see if it's working.
This is what I did, maybe not the best solution, but a try:
First at all i made a wrapper --> changed nippon to wrapper, you can change it back ofcourse. just to make the code more structured. inside the wrapper you can put all your stuff, the wrapper will be centered because of the declaration in body: text-align:center.
Second, i made a header div inside the wrapper, this one is floated:left and used your image as background.
Now finally the next part is the link part of you, i made another div to put inside the header, ( your navigation ). What I did is I cleared the padding, and then adjusted the margin so that is positioned at the right place. Inside the navigation div I put the link <p> link1 link2 etc.etc </p>
Also in your css u can find a css for .navigation p, where set the padding and margin to 0, default the browsers will add padding/margin. Check the source of the css and php file, should be self expl.
btw. hope you are ok that I messed with ur stuff . . I will remove your source shortly, since it is copyrighted and stuff heh.
edit: The way johnyriv posted should work too . . I didnt really looked at all the code, thought starting from scratch will be faster hehe. U can use abs. positioning instead of margin.
Yeah that is exactly like i wanted it. Im gonna look through your code carefully so i can learn it once and for all :) Thanks for taking your time to help me with this. This will be my first site i design fully with CSS . Really a shame really that i have so long designed with tables :/ It`s like day and night.
You should also try to get the same effect using absolute positioning, I think using that makes more sense . . Actually, the real problem was what johnriv said, the navigation div was not put properly. If you put that in ur header again, you should be able to get the same effect.
I think a good way to learn css is to try looking for a page that has the stuff you want, or something that looks like it, and then learn from that. By viewing the page source u can learn a lot !
Got another problem now. I need to another divlayer below the navigation layer but it needs to be to the left of it. When i add another divlayer it cant more to the left of the navigation. But i dont see any way i can start in a new linebreak to insert the layer, if i do that then the layer gets placed below the wrapper.
oohhh, thats because of the margins of the navigation layer, it filled the whole left side so you cant put anything there. If that's the case, I think you wil have to do it the way johnriv was saying. put the navigation in the header div ( should be already in the header div now ) and then you can position the navigation without using the margin way. Then you can do the same for the div you want on the left.
using the margin way . . you can also float the navigation to the right, and then adjust the right margint instead of the left margin, that way you keep the left margin zero where u can put another div.
I suggest you to do it like johnriv said . . that way u can always put everything where u want, without having problems of marigns covering spaces you may need.
I seriously feel like hugging you and johnriv ofcourse :) I recoded the entire thing step by step taking your advice and now it worked. It couldn`t be any easier. I almost got a bit frustrated since i didnt understand the logic behind positioning but now i completely understand. Seriously thanks alot :) I owe you both .