CSS - Internal Style Sheet


CSS - Internal Style Sheet 

  • When a browser reads a style sheet, it will change the HTML document in accordance with information in the style sheet.
  • CSS Style sheet describes the presentation of an HTML document in the browser window.

Internal Style Sheet :

  • An internal style sheet is used if a single web page has a different style.
  • Internal styles are defined within the <style> element, inside the<head> section of an HTML page.

Sample Code :

<html>
    <head>
        <style>
            h1 {
            color:blue;
            }
        </style>
    </head>
	   <body>
            <h1>Welcome ToWikitechy</h1>
            <p>Just a normal paragraph</p>
	   </body>
</html>

Code Explanation :


    Here we have Opened the style tag(<style></style>) inside head section of the html page. H1 element is used to CSS to specify the heading of a web page. 

    Color property is used to specify font color for the html element contents. Here we are applying blue color for the h1 text.

    Over here, the text “Welcome To Wikitechy” is the heading of our web page which will have styles that applied internally. 

Output :


    The text “Welcome to wikitechy” will appear in blue color which we can see in the output.

    The text “Just a normal paragraph” will appear normally for which we have not specified any styles.