• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Style Sheets in HTML

External Style Sheet

If you have to give same look and feel to many pages then it is a good idea to keep all the style sheet rules in a single style sheet file and include this file in all the HTML pages. You can include a style sheet file into HTML document using <link> element. Below is an example.

<head>

<link rel=”stylesheet” type=”text/css” href=”yourstyle.css”>

</head>

Internal Style Sheet

If you want to apply style sheet rules to a single document only then you can include those rules into that document only. Below is an example :

<head>

<style type=”text/css”>

body { background-color: pink; }

p{color:blue;20px;font-size:24px}

</style>

</head>

Inline Style Sheet

You can apply style sheet rules directly to any HTML elemet. This should be done only when you are interested to make a particular change in any HTML element only. To use inline styles you use the style attribute in the relevant tag. Below is an example:

<p style=”color:red;font-size:24px;”>Using Style Sheet Rules</p>

Summary
Review Date
Reviewed Item
Style Sheets in HTML
Author Rating
4

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Style Sheets in HTML"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.