Game Development Reference
In-Depth Information
You can also change the style in the HTML document itself rather than using CSS files to define the
style. This is done by setting attributes of a tag. For example, the body of the following HTML page
has an attribute tag style that is set to change the background color to blue (see Figure 1-3 for the
page that is displayed):
<!DOCTYPE html>
<html>
<head>
<title>BasicExample</title></head>
<body style="background:blue">
That's a very nice background.
</body>
</html>
Figure 1-3. A simple web page with a blue background
You can change different aspects of the style by using a style attribute as in the example. For example,
look at the following HTML document:
<!DOCTYPE html>
<html>
<head>
<title>BasicExample</title></head>
<body>
<div style="background:blue;font-size:40px;">Hello, how are you?</div>
<div style="background:yellow;font-size:20px;">I'm doing great, thank you!</div>
</body>
</html>
 
Search WWH ::




Custom Search