...

View Full Version : CSS Image Banner Centering Issues



SwitchSkimFL
01-03-2010, 03:53 AM
Im coding a band's myspace and am having issues with the positioning of a top banner. Its absolutely positioned so it looks fine on a widescreen 1600x900 resolution, but its too far left on a standard 1024x768 resolution. ive tried a couple of different center tags and stuff but cant figure it out and nothing works. help please?

www.myspace.com/releasetherivermusic

this is the code im using



<style>
body{
background-position:top center;margin-top: 575;}

div.topbanner {
top: 0;
left: 50%;
margin-left: -792px;
width: 100%;
height: 600px;
position: absolute;
}
</style>

<div class="topbanner"><img src="http://i260.photobucket.com/albums/ii38/Overtonerocks/Bannertopv3Final1b.jpg" /></div>


thanks in advance

vineet
01-03-2010, 09:04 AM
absolute positioned divs dont move according to screen resolution. If you want your div to position itself acording to resolution then insert it inside an relative positioned div.

vineet

SwitchSkimFL
01-04-2010, 06:02 PM
absolute positioned divs dont move according to screen resolution. If you want your div to position itself acording to resolution then insert it inside an relative positioned div.

vineet

let me go ahead and apologize in advance-im not good at code at all. i do management tho so it comes with the turf. haha

i understand what you are saying about relative and absolute positioning but i had no clue how to do it so i basically googled "relative positioned div" and tried to DIY it to no avail. the closest i got was having a 'blank space' at the top where the banner should be but the banner was near the bottom and to the left a bit (i never could figure out what was pushing it left)

could you explain how i can change the absolute code to a relative one that centers the image at the top of the page. i wish i knew more so i could be more specific with my question but im trying to learn some of this stuff as i go.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum