Web Technologies - Old Questions

7.  How can you insert internal style sheet in your HTML document? Discuss with example.

5 marks | Asked in 2071

The internal style sheet is used to add a unique style for a single document. It is defined in <head> section of the HTML page inside the <style> tag.

E.g. 

<!DOCTYPE html>  

<html>  

<head>  

  <style>  

    body {  

        background-color: linen;  

    }  

    h1 {  

        color: red;  

        margin-left: 80px;  

    }   

  </style>  

</head>  

<body>  

    <h1>The internal style sheet is applied on this heading.</h1>  

    <p>This paragraph will not be affected.</p>  

</body>  

</html>