...

View Full Version : Myspace coding help :[



imclintoncole
04-06-2009, 02:55 AM
<style>
body {
margin-top: 330px;

}

div.topbanner {
position: absolute;
top: 0%;
left: 24%;
width: 800px; <--- set your image width
margin-left: -400px; <---- make this HALF your image width.
height: 192px; set the height of the image. Should be less then the Margin height set in the body.
}
</style>



<div class="topbanner">
<img src="http://i43.tinypic.com/106y977.png" />
</div>

That's the code I use for the top banner on my myspace, it centers it on my computer but when i go on others it's not centered, what's the fix :[ anyone know please?


www.myspace.com/imclintoncole

also I want the background to start orange (the color of the lines on my myspace) and to fade into white && I Know how to do it if I were to just create a giant background but it never looks the same on other computers, someone help please :[

RomanTaylor
04-06-2009, 03:07 AM
To center something using CSS you need to add this into your CSS rule:


div.topbanner {
position: absolute;
margin-top: 0%;
margin-left: auto;
margin-right: auto;
width: 800px;
height: 192px;
}

margin-left: auto;
margin-right: auto;

You can find all needed info related to the CSS backgrounds here (http://www.w3schools.com/css/css_background.asp).

I hope this help you out.
Best regards.

imclintoncole
04-06-2009, 03:15 AM
<style>
body {
margin-top: 330px;

}

div.topbanner {
position: absolute;
margin-top: 0%;
margin-left: auto;
margin-right: auto;
width: 800px;
height: 192px;
}

margin-left: auto;
margin-right: auto;
</style>



<div class="topbanner">
<img src="http://i43.tinypic.com/106y977.png" />
</div>


It shows the image under my "About me" after I changed the code to what you posted :(

imclintoncole
04-06-2009, 03:19 AM
Alright so I switched


margin-top: 0%;
to

top: 0%;

&& now it's at the right position vertically, but not horizontally. Any ideas?

imclintoncole
04-06-2009, 03:56 AM
Got it, thanks guys :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum