mattjc
11-10-2010, 09:15 PM
Hi all,
New to codingforums... and got a frustrating problem. Not sure whether it's a HTML or CSS problem. Relative noob. (not a positioning pun there)
Please see HTML segment below.
<div id="parent_wrapper">
<div id="child">
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
CSS Below:
body {
background: #000000 url(../images/d4t_bg.jpg) repeat-x;
margin: 0px;
font-family:Arial, Helvetica, sans-serif;
}
#parent_wrapper {
width: 811px;
height: 675px;
margin: auto;
background-image:url(../images/d4t_header.jpg);
}
#child {
background:#000000;
width: 763px;
height: 400px;
margin: auto;
position: relative;
top: 443px;
}
As you can see, I have a bg image (it's just a 40px x 675px strip) which repeats along the X axis.
This image continues into the image contained in the #parent_wrapper and all works fine until i put my <ul> tag into my html.
Then, it would seem that my #parent_wrapper div moves down from the very top of the page by about 20px, shifting my header image out of line with my bg gradient.
If I am not being too vague, can anybody suggest a reason for this?
I have exercised every bit of trouble shooting I can think of (at my amateur level) adjusting padding and margins to try and get the #parent_wrapper to butt up to the top of the page again.
Any thoughts would be much appreciated. I will post an image if necessary.
thanks.
New to codingforums... and got a frustrating problem. Not sure whether it's a HTML or CSS problem. Relative noob. (not a positioning pun there)
Please see HTML segment below.
<div id="parent_wrapper">
<div id="child">
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
CSS Below:
body {
background: #000000 url(../images/d4t_bg.jpg) repeat-x;
margin: 0px;
font-family:Arial, Helvetica, sans-serif;
}
#parent_wrapper {
width: 811px;
height: 675px;
margin: auto;
background-image:url(../images/d4t_header.jpg);
}
#child {
background:#000000;
width: 763px;
height: 400px;
margin: auto;
position: relative;
top: 443px;
}
As you can see, I have a bg image (it's just a 40px x 675px strip) which repeats along the X axis.
This image continues into the image contained in the #parent_wrapper and all works fine until i put my <ul> tag into my html.
Then, it would seem that my #parent_wrapper div moves down from the very top of the page by about 20px, shifting my header image out of line with my bg gradient.
If I am not being too vague, can anybody suggest a reason for this?
I have exercised every bit of trouble shooting I can think of (at my amateur level) adjusting padding and margins to try and get the #parent_wrapper to butt up to the top of the page again.
Any thoughts would be much appreciated. I will post an image if necessary.
thanks.