FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Help With Positioning Background Image.

 


Dougie1
What I want is a centred background image, which only appears once on the page but the whole image appears on the page as well.

Just now I have
Code:
<style type="text/css">
body
{
background-image:
url('Full.png');
background-repeat:no-repeat;
background-position:center
}
</style>

The problem is though, that the image positions its self out side the window. like this.

I would like it positioned like a centred image only as a background image so that it doesn't get in the way of my page. Like this.

As an incentive to help me I would say you can have all my fri$ but as I don't have that many I don't think it would help!

You can have them if you manage to help me though. Thanks in advance Smile
BooTes
Just use..

Code:
background-position: top center;


.. and it should work.
webgeek
Centering an image using CSS can be a problem because not all browsers will support it. I'd suggest putting the background in a centered table.
riv_
If I need to center an image, I always use percentages, rather than the "center" attribute. you can tell the browser to display your image at a certain point vertically and horizontally. So 0% 50% would be top center. Works better cross-browser.
(I use shorthand notation though... I'm assuming it works the same way when the background-position is declared separately, but I don't remember for sure... I'll have to look it up...)
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.