Tanmccuin
07-18-2006, 12:05 AM
Hi,
I'm in the process of designing a page for a local record store and so far all is good, but recently i've hit a snag. I'm trying to layer a transparent png over the header img - and also making sure the transparent image, remains relativly positioned to the header div, not the body.
As i have it now it works so far, insomuch that the image hovers over the header, but as i resize my window the img (a logo.png) moves relative to the size of the browswer window. i need it to stay aligned w/ my header div, which moves to remained centered as the window resizes.
here is some html:
<body>
<div class="page-container">
<!-- HEADER -->
<div class="site-name">
<div class="site-slogan">
Home of Underground Prices
</div>
</div>
<div><img class="img-header" src="./img/header1.jpg" alt=""/></div>
<div><img class="floating-img" src="./images/label3.png" alt="Pure Pop logo"/></div>
-------------
and the corosponding CSS:
body {font-size: 62.5%; margin: 0em auto; padding: 0px; font-family: arial, tahoma, verdana, sans-serif; background: url(../img/background.gif) top center repeat-y;}
.floating-img {
position:absolute;
top:-100px;
left: 120px;
.img-header {clear: both; float: left; width: 770px; height: 100px; margin: 0px; padding: 0px;}
--------------------
I'm relatively new to CSS, and while i've been able to figure out most my issues with alot of trial and error, this one is really giving me a hard time. To my understanding what i need to do is make the logo relative not to the body but the header div, that way it stays aligned with the header image - when i do what i think is this, it instead causes the entire body of the page to shift to the left, while the header stays centered on the page, and the logo image, remains absolute to the body (not the header.)
I'm probably not explaining myself well enough.... if you need more info please let me know. This is driving me nuts, and i could really use some help at this point,
Thank you!
Tanner M:eek: :eek: :eek: :eek:
I'm in the process of designing a page for a local record store and so far all is good, but recently i've hit a snag. I'm trying to layer a transparent png over the header img - and also making sure the transparent image, remains relativly positioned to the header div, not the body.
As i have it now it works so far, insomuch that the image hovers over the header, but as i resize my window the img (a logo.png) moves relative to the size of the browswer window. i need it to stay aligned w/ my header div, which moves to remained centered as the window resizes.
here is some html:
<body>
<div class="page-container">
<!-- HEADER -->
<div class="site-name">
<div class="site-slogan">
Home of Underground Prices
</div>
</div>
<div><img class="img-header" src="./img/header1.jpg" alt=""/></div>
<div><img class="floating-img" src="./images/label3.png" alt="Pure Pop logo"/></div>
-------------
and the corosponding CSS:
body {font-size: 62.5%; margin: 0em auto; padding: 0px; font-family: arial, tahoma, verdana, sans-serif; background: url(../img/background.gif) top center repeat-y;}
.floating-img {
position:absolute;
top:-100px;
left: 120px;
.img-header {clear: both; float: left; width: 770px; height: 100px; margin: 0px; padding: 0px;}
--------------------
I'm relatively new to CSS, and while i've been able to figure out most my issues with alot of trial and error, this one is really giving me a hard time. To my understanding what i need to do is make the logo relative not to the body but the header div, that way it stays aligned with the header image - when i do what i think is this, it instead causes the entire body of the page to shift to the left, while the header stays centered on the page, and the logo image, remains absolute to the body (not the header.)
I'm probably not explaining myself well enough.... if you need more info please let me know. This is driving me nuts, and i could really use some help at this point,
Thank you!
Tanner M:eek: :eek: :eek: :eek: