Jump to content

Recommended Posts

Posted

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.

Posted

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...

Posted

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.

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
×
×
  • Create New...