Jump to content

how do you make simple background out of image


Recommended Posts

I have an image of a sea/sky that comes up tiled when I put it on my website.

I just want 1 image of the sea/sky on my website not all the little tiled squares of the sea/sky.

How do I got about doing this? do I make the image larger, and if so how large? etc.

Thanks, Onchee

Link to comment
Share on other sites

CSS for it:

selector {
background-color: #HEX;
background-image: url(PATH TO IMAGE); 
background-repeat: no-repeat;
background-position: POSITION;
}

The background-color property controls the space that the image does not fill up. The 'selector' is the element, class, or element ID you want the image to appear as it's background. So if you want your site's background to be an image, you probably would insert body in place of selector.

The path to the image can be a web url or a system file. And the POSITION part can be replaced with the following:

top left

top right

bottom left

bottom right

center

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"

[ dA Paint.NET Chat :: Yata on dA ]

Link to comment
Share on other sites

Is it also possible to stretch the image to cover the entire visible window?

Not purely with CSS. I researched this long ago, and it can only be 'extensively' done with CSS+Javascript, or possibly a SSL language like PHP. I assume you would check the user's screen resolution and output the correct supplementary image.

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"

[ dA Paint.NET Chat :: Yata on dA ]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...