Page 63 - Touchpad_Plus_V3.2_Class 6
P. 63
Now, save the file with the name style.css at the same location as the HTML file. Again, open a
new notepad window and type the following code:
<!DOCTYPE html>
<html>
<head>
<title> Using External Stylesheet</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
Text with white colour and background colour is green
</body>
</html>
When you view the preceding web page in browser, you will get the following output:
Output
You can also use the 6 digits hexadecimal code in place of colour name. For example, the
hexadecimal code #000000 represents the black colour and #FFFFFF represents the white colour.
For example:
body{background-color: #000000;}
You can also set an image as the background of a web page by using the background-image
property of CSS in the following manner:
body{background-image:url("background.jpg");}
EDITING AN EXISTING HTML DOCUMENT
Follow these steps to edit an HTML document:
Step 1 Right-click on the file icon.
Step 2 Click on the Open With Other Application option.
Introduction to HTML5 & CSS3 61

