amitte Posted December 22, 2008 Report Posted December 22, 2008 hy... i'm trying to put an image in my background but i run into a major prob- well... i pot my img in one of my "div"s. and like u said in the article "http://www.killersites.com/articles/newsletterArchive/Newsletter_March17_2004.htm" i put all the values (background-image/repeat/attachment)... and my prob is with the position!!! i set it at "top left" well.. i do get it on the top left... but of the whole page!! and i want it only at the top left of my special div.... i tried margin's and padding's of the hole and the div.... but nothing worked.... i need your help... pleas... thanks in advance.. amit p.s- i use an external CSS file for this. like u said. and i put al the values in the relevent ID of the div.... thanks. Quote
falkencreative Posted December 22, 2008 Report Posted December 22, 2008 what's the CSS/HTML you are using? Hard to say without seeing the code. Quote
amitte Posted December 23, 2008 Author Report Posted December 23, 2008 first of all- thanks for the fest answer... ----------------------- try try #main { position: absolute; width: 550px; height: 500px; margin-right=400px; background-attachment: fixed; background-image: url(img/bg1.jpg); background-repeat: no-repeat; background-position: top left; } --------------------this is the relevent part... if u need more let me know... Quote
JBall Posted December 23, 2008 Report Posted December 23, 2008 Try this: Put your whole site into a div. I call that a wrapper. html Try Try css #wrapper{ margin:0 auto; width:800px; height:auto; } #main { position: absolute; width: 550px; height: 500px; margin-right:400px; background-attachment: fixed; background-image: url(img/bg1.jpg); background-repeat: no-repeat; background-position: top left; } Also notice that you are missing a colon in the "margin-right" line. Replace the equals sign and wrap your site and you should be golden. Be sure to set the width of your site in the wrapper. I have 800px in there your site may be different. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.