answersLogoWhite

0

HTML for adding a background color?

Updated: 8/10/2023
User Avatar

Wiki User

12y ago

Best Answer

It's not HTML. Background color is a CSS style. You need to put in either a stylesheet, or attach the style attribute to the tag whose background color you're trying to set. For instance:

<p style="background-color:blue;">This paragraph would have a blue background.</p>

Colors in CSS can be set using names (there's 170 or so of them)

Via a hexadecimal RGB value:

<p style="background-color:#b3b3b3;">This a meduim gray. The pairs of hex digits correspond to RGB.</p>

Using RGB directly:

<p style="background-color: rgb(179,179,179);">This is the same color as #b3b3b3</p>

And using RGBA (which gives you an alpha channel, letting you set transparency)

<p style="background-color: rgba( 179, 179, 179, .5 );">This paragraphs background color would be 50% transparent.</p>

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

To give a background color to a HTML element, add "background-color:(color)" to its style-attribute.

Example: Text with red background

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: HTML for adding a background color?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the preferred way for adding a background color for HTML?

The preferred method for adding background color to an element is not through HTML, but rather through CSS (i.e. the background-color statement). Older versions of HTML support the now-deprecated (and soon obsolete) bgcolor element attribute.


What is bgcolor?

bg color is the abbreviation of background color there is a command used in HTML which set the background color which u want


What is the code of backround in HTML?

Background can be easily added into the HTML code. in the &lt;style&gt; element you can add background-color="red".


What is the background code for a HTML document?

A background can be added on CSS. ex: #body {background: url(../images/bodybg.jpg) repeat-x;}The HTML code for background color is Note: The code must be put inside the body tag, that is between and of your HTML script and the values of color can be change accordingly. For example, if you want to put gray background color you simply change the value to "#727272" or "#000000" for black if you want.


What is a HTML code for a background on tinierme?

If for an image: &lt;body background="images/background.jpg"&gt; or if for a color: &lt;body bgcolor="#000000"&gt;


What isit called to draw reader's attention by adding color to the background?

shading


What is the default background color for the canvas element in HTML 5.0?

The default background color for the &lt;canvas&gt; element in HTML5 is the same as the browser default background color. If there is a style sheet or &lt;body&gt; tag that defines the color, &lt;canvas&gt; will inherited that color. You can add style attributes to the &lt;canvas&gt; tag to set a different default background color for the element.


How do you write the CSS and HTML code for an embedded style sheet that configures a background color of?

&lt;style type="text/css" media=screen&gt; body{ background-color: gray;} &lt;/style&gt;


What HTML do you use to put a background colour on?

In the body section of your HTML page, you need to add a line like this: style="color: rgb(0, 0, 0); background-color: rgb(187, 255, 238);" Different editors may implement a slightly different style. Here is an HTML example reference. There are lots on the web to assist you. http://www.w3schools.com/HTML/html_examples.asp


What is the colour of the page behind the text?

For an HTML docuement the default page background color is determined by the browser. The most background color is white. You can define a page background color in different ways. A preferred HTML5 method is to a CSS style to define the color. One way you can do that is like this: .


What is the correct CSS for adding a background image to a page?

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.


How do you make a background on stardoll presentation without word or firefox?

Any Web Browser is available for your Presentation. Not using Firefox just limits you of Flashing Text and some Multiple Borders.You are able to use HTML Codes (preferred) or different coding for your background and multiple effects. Plus, you can drag Backgrounds from different users on Stardoll, which I suggest you to create your own preferred background. I include you the HTML Code for Backgrounds with Text Alignment, Font, Font Size, Font Color and Text Shadow included. For different colors you can use to modify your background code I included 'Computer Hope: HTML Color Codes and Names.'Background Code:Background HTML CodeIf you just want the background code you can just use:Background HTML CodeYou edit the color of the Background, deleting "8B0000" for "red" or other colors listed on the page I included before. You write on the "Background HTML Code" with other text of your choice. If you need more information about HTML Codes you can contact me on my Message Board.Answered by Megajessica225 add me :) and heart my yb