What is a style sheet?

A style sheet is an external CSS file that contains the CSS rules to design the layout of a website. These rules apply css properties on HTML elements. It makes a website more attractive. It is embedded in an HTML by <link> tag. For example, we have an HTML file (text.html) that uses a style sheet named designsheet.css. Both files are in the same folder. Now see the HTML.

<!DOCTYPE html>
<html>
<head>
<link href="designsheet.css" rel="stylesheet">
</head>
<body>

<div class="box">This is a box.</div>

</body>
</html>

And now we see the code in CSS file.

.box{
width:100%;
height:200px;
background-color:lightblue;
}

Now the above given class named .box is being applied on div element that have class="box". You can find more at CSS stylesheet.
 
Last edited:
Back
Top