answersLogoWhite

0

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

14y ago

What else can I help you with?

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 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 bgcolor?

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


Which attribute is used to give background color in textbox in HTML?

In HTML, you can use the style attribute to give a background color to a textbox (input element) by specifying the background-color property within the style. For example: &lt;input type=&quot;text&quot; style=&quot;background-color: yellow;&quot;&gt;. Alternatively, you can also set the background color using CSS by targeting the input element in a stylesheet.


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 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 isit called to draw reader's attention by adding color to the background?

shading


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.


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