Style sheet in html

What you will learn here about CSS

  • CSS Stylesheet types

CSS Stylesheet types:

CSS helps to design the content to be displayed on the browser. Using CSS we can style the color of the text, change the size of font, apply background color, change in the appearing of image or text and many more.
There are three ways of applying CSS property to the element in HTML.

  1. Inline CSS
  2. Internal CSS
  3. External CSS

1. Inline CSS

In this way styling property is applied to an element within the element itself by using style attribute.

Example: Inline CSS


<p style=”color:red; font-size:14px;”>This is example of inline CSS</p>

This is example of inline CSS

2. Internal CSS

In this way styling property is defined within the head element between style tag

Example: Internal CSS


<head>
<style>
p{color:red; font-size:14px;}
</style>
</head>

This is example of Internal CSS



3. External CSS

In this way of styling all the styling property has to be defined in an external file and file has to be saved with filename.css extension. And a reference is added in the html document to access the properties using link tag

Example: External CSS


<head>
<link href=”https://bytesofgigabytes.com/codes/example.css” type=”text/css” rel=”stylesheet” />
</head>

This is example of External CSS

 

You may also like...