Background-color

From Frontal Wiki

Jump to: navigation, search

Contents

Purpose

This style sets the background color of a visual element.


Value

A hexadecimal representation of an RGB color like "#RRGGBB" or the name of a color. By default, this style is not set.

background-color: #ff0000;


Remarks

An element must have some non-zero dimensions for this style to work. This is most easily done by giving the element width and height styles though the example below shows how the intrinsic dimensions of a 'text' tag can also achieve this.


Example

Notice in this example how we set the background color of the 'document' tag to change the background color of the whole, rendered document.

<style><![CDATA[
	document
		{
			background-color: silver;
		}
	text
		{
			margin: auto;
			color: blue;
			font-size: 96px;
			font-family: Swift LT Std;
			background-color: darkorange;
		}
]]></style>
<include rel="assets" blocking="true" src="assets.swf" fontClasses="SwiftLTStd" />
<text><![CDATA[Hello, world.]]></text>

Can Be Applied To

This style can be applied to any visual element:

Personal tools
Get Adobe Flash player