answersLogoWhite

0


Best Answer

Use the attribute BGCOLOR=".." inside the start Body tag using the color you want as the value. It should look like this: this will give you a black background, and at the end of your HTML document you close the Body Of cause if you use a black background you cannot use black font. You won't be able to see it. You can set the value=".." of the background to what ever you like.

User Avatar

Warren Thiel

Lvl 10
2y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

You can display an image backgound within an HTML web page.

The BODY tag follows the HEAD tag within an HTML web page document.

The contents of your web page is displayed between the BODY tags. This includes everything displayed when viewed through a web browser.

You can display an image background within an HTML web page by adding the BACKGROUND attribute to your HTML BODY tag.

However, please ensure you select your image very carefully and ensure your text can be easily viewed.

However, please keep in mind, the best background color for a professional web page is always white.

Copy and paste the HTML BACKGROUND attribute into the BODY tag of your HTML code.

BACKGROUND="yourimage.gif"> Edit the text indicated in red to the image you would like to display as your web page background.

Although you can display an image background within your HTML web page, it is always best to display black text on a white background.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Use the attribute BGCOLOR=".." inside the start Body tag using the color you want as the value. It should look like this: this will give you a black background, and at the end of your HTML document you close the Body Of cause if you use a black background you cannot use black font. You won't be able to see it. You can set the value=".." of the background to what ever you like.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

body { background: url("yourImage.jpg") center center; }

This code will add an image to the center of your page.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

The correct CSS is

div-name {

background: url(image-name.png)

}

or

div-name {

background-image: url(image-name.png)

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the correct CSS for adding a background image to a page?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

If you have chosen both a background color and a background image for a page within your site?

This is actually a very good idea, especially if you have a dark background image. The background color will almost always work (unless the browser doesn't support any colors at all) but the background image may not load properly or may take a long time to load. If you have light text on a dark background image, the text will not be readable against the default white background until the background image appears. If something goes wrong with the image download, the user may never be able to read the text. It's a good idea to assign a background color that is similar to the background image to prevent this problem.


How do you add an image to your background on your wikia?

Depends on how you are able to edit the code. This is the basic CSS way for a web page: Background Image Code: For the body tag example: body { width: XXpx; height: YYpx; margin: 0 auto; background: #fff url(image_name.jpg) no-repeat center scroll; } That is the proper CSS code for a non-tile image where the contents scroll with the background image. Change "#fff" to preferred bg color. Change "scroll" to "fixed" if you want page contents to scroll over bg image. Be sure to set proper width/height to provide minimum page size to display bg image. Put the CSS as is on an external CSS file. If using embedded CSS, then place CSS between the style tags and place those style tags between the head tags of the page.


What is the HTML tag for a background?

There is no HTML tag for a background as such. You put in backgrounds by using the attributes of certain tags, depending what you want to put a background on and how you want to display the background. You can also use styles to do it. You can have a colour or an image as a background. The bgcolor attribute is used in a lot of different tags to put background colours on things. So if you wanted the background colour of your page to be red, then you would have the Body tag with the bgcolor attribute like this:If you wanted an image as the background to your page, you'd have:Using styles you can do more complicated things with backgrounds. For example, you can use a style to put a background on a paragraph in different ways:This paragraph will have your image as a background repeating horizontally.Your paragraph text goes hereThis paragraph will have your image as a background displaying only once.Your paragraph text goes hereThose are just 2 ways, but there are lots more, and they can be applied not just to paragraphs but to other structures like the body or a table or whatever you want.


How do I configure a background image for a webpage using CSS?

There are a couple of ways to accomplish this: Inline CSS: <span style="background-color: #FF0000;">Blah</span> Or via a CSS Style: <style type="text/css"> .styleName { background-color: #FF0000; } </style> <span class="styleName">Blah</span>


How can you insert an image as a background if it is stored anywhere in the system?

You can display an image with HTML as long as you know the location of the image. You use the image tag like this: <img src="...\anywhere\image.jpg" width="100" height="100" alt="My Image" />.

Related questions

How to use CSS in making the picture a background?

To make a picture a background of a web site using CSS, you will use the different background properties, which are: background-color, background-image, background-repeat, background-attachment, and background-position. The specific property you are looking for is background-image. To use this property you would declare in your style sheet the following: body { background-image: url('paper.jpg'); } This is telling the web browser to use the image paper.jpg and make it the background of the entire page. The other background properties control whether the backgound is repeated along the x and/or y axis, the position on the screen the image begins at, whether the background is fixed or scrolls with the page, and the background color.


What is the HTML codes for a picture in the background?

You can easily adjust the background of a web page as a picture. It can be set as : background-image="url('url-source')."


How do to create a static webpage with only one image as background?

Use html only and that should give you a static page. You can put image as background by using css


What is a print ad that bleeds?

Any print ad where either the image or background color is extended to edge of the page is a bleed. Meaning the image is "bleeding" off the page.


How do you set a horizontally and vertically repeating background image to an HTML page using inline CSS?

Use the "style" attribute in the "body" tag to set inline styles. Set the "background-image" and "background-repeat"CSS attributes to the body element. "background-image" should have a path to the image you want as a background, and "background-repeat" should have "repeat," indicating you want the image to tile both horizontally and vertically. For example (replace path-to-image.jpg with a relative or absolute path to the background image of your choice): ---- ... ----


How do you change the background on your yahoo profile?

On the main profile page under the user image, username and description click "CHANGE COVER IMAGE". You can then choose from one of the predefined Flickr background images. You cannot upload a custom image.


How do you browse another another background to my gmail page?

You can change the background to any image as homepage. The image can be a part of the drive, a picassa album or a URL too. You can select Google Images as well.


You want to create a watermark image. Which tab on the Format Picture box would you use?

It is on Page Layout tab in Page Background section


If you have chosen both a background color and a background image for a page within your site?

This is actually a very good idea, especially if you have a dark background image. The background color will almost always work (unless the browser doesn't support any colors at all) but the background image may not load properly or may take a long time to load. If you have light text on a dark background image, the text will not be readable against the default white background until the background image appears. If something goes wrong with the image download, the user may never be able to read the text. It's a good idea to assign a background color that is similar to the background image to prevent this problem.


How do you add pictures to you web page in web page design?

Adding picture to a web page is simple. It includes using a HTML tag: img The format of img tag is: <img src="location of the image"> One can also add a name to be displayed when one rolls over the image or when the image file is missing by: <img src="location of the image" alt="Image Name">


Ias this a correct sentence 'See the next page for more details in Adding Bullets and Numbers?

I would say " For more details regarding adding bullets and numbers, see following page."


How do you add an image to your background on your wikia?

Depends on how you are able to edit the code. This is the basic CSS way for a web page: Background Image Code: For the body tag example: body { width: XXpx; height: YYpx; margin: 0 auto; background: #fff url(image_name.jpg) no-repeat center scroll; } That is the proper CSS code for a non-tile image where the contents scroll with the background image. Change "#fff" to preferred bg color. Change "scroll" to "fixed" if you want page contents to scroll over bg image. Be sure to set proper width/height to provide minimum page size to display bg image. Put the CSS as is on an external CSS file. If using embedded CSS, then place CSS between the style tags and place those style tags between the head tags of the page.