Jump to content

probs with positioning


amrita
 Share

Recommended Posts

I want to place a picture at a specific place on my page, so in css i use div to position it, however it does not place itself where i tell it to..what am i doing wrong or forgetting in the code? And also the background image is completely off in firefox - why?<code>body {margin: 0px;background-color: #000000;text-align: center;}#main {background-image: url(../images/baggrund.gif);background-repeat: no-repeat;width: 1024px;height: 768px;margin-left: -512px;margin-right: -512px;margin-top: 0px;text-align: center;}#picture {position: absolute;left: 300px;top: 219px;width: 649px;height: 316px;}</code>

Link to comment
Share on other sites

you set the body as margin:0; so the page is centered. But you use absolute positioning for your picture. Height attribute also does not work in CSS. With the background image, where do you want it? With that code it will sit in the top left corner...And whats with the minus margins?:)

Link to comment
Share on other sites

you set the body as margin:0; so the page is centered. But you use absolute positioning for your picture. Height attribute also does not work in CSS. With the background image, where do you want it? With that code it will sit in the top left corner...And whats with the minus margins?:)
I want the background to be centered on the page.. and it is in IE 6, but not in FF - i've used the minus margins before to center something - is that what's causing the problem? And I want the picture to be placed left: 300px; top: 219px; - but it isn't :-/
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...