Home / Tutorial / CSS Styling In Web Designing | Types Of CSS | HTML5 with CSS3

CSS Styling In Web Designing | Types Of CSS | HTML5 with CSS3

What Is CSS?

Cascading Style Sheet

CSS Stands for Cascading Style Sheet. CSS is used to stylize the HTML elements or we can say that CSS is used to stylize the HTML structure. There are many ways to stylize the elements in CSS we will take a look later. First, let’s discuss the Cascade Style Sheet syntax and how to use it inside the HTML structure to stylize.

Cascade Style Sheet Syntax

There are three ways to apply CSS to HTML elements

  1. By Elements
  2. By Class
  3. By Tag

 

 

By Element:-

We Can Apply The CSS directly On The HTML elements for example if we want to apply on the div element we can directly use like this

div{


    Attribute: value


}

Attributes Can Be Anything for example background, color,font-size.

div{


   background: "blue";
   font-size: 12px;


}

How To Embed Cascade Style Sheet Inside the HTML

If we want to add the Cascading Style Sheet inside the html there are three ways to do that . It is known as following

  1. Internal
  2. External
  3. Inline

 

Internal Style Sheet

If we want to include the internal style sheet we need to add it inside the <style> </style> tag . Style tag can be added anywhere inside the html page but the common practice is to place the style tag inside the head tag in html.

<!DOCTYPE html>
<html>
<head>
<title> Internal Style Sheet </title>

<style>

h1{

   background:blue;
   height:200px;
   color:#fff;

}

</style>

</head>
<body>
<h1>Hello World</h1>
</body>
</html>

 

About tayyab_no_access

Check Also

Getting Started With HTML | How To Create A WebPage In HTML

Getting Started With The HTML. First, we need to understand what is HTML. HTML is

Leave a Reply

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