Page 82 - TP_Plus_v4_Class6
P. 82
Where, element is any valid HTML tag and the style is the global attribute of HTML used by all the tags
of HTML. The style attribute contains all the CSS properties and their values within double quotes. For
example:
<body style="background-color:green; color:white">
Text in white colour
</body>
Internal Style Sheet
CSS design can also be applied into an HTML document by using <STYLE> tag. This tag should be placed
inside the <HEAD> and </HEAD> tags. An internal style sheet is commonly used when one web page
has a unique style. For example:
<head>
<style>
body{background-color:green; color:white;}
</style>
</head>
<body>
Text in white colour
</body>
External Style Sheet
In case of external stylesheet, the CSS styles are written in a separate file which is saved with .css
extension. You need to include a reference to the external style sheet file within the <LINK> element
inside the <HEAD> section. Syntax to include the reference of external stylesheet is:
<head>
<link rel=“stylesheet” type=“text/css” href=“name of style sheet”>
</head>
Where, HREF attribute contains the path of the stylesheet. For example, if you have saved the external
file with the name style.css, then the code will be:
<head>
<link rel=“stylesheet” type=“text/css” href="style.css">
</head>
You need to give complete drive path of the stylesheet, if the file is saved at any other location. Let us
create a web page using the external style sheet. The first step is to create stylesheet file. Open the
Notepad and type the following code:
body{background-color:green; color:white;}
Now, save the file with the name style.css at any location. Now open a new file in notepad window and
type the following code:
<!DOCTYPE html>
<html>
<head>
80 Plus (Ver. 4.0)-VI

