Tuesday 15 May 2018

Learn Web Development - Adding CSS to HTML (URDU / HINDI) Tutorial



There are three ways to incorporate, embed or attach CSS with HTML web page:

1 - Inline CSS
2 - Internal CSS
3 - External CSS

All of the above methods have their own specific syntax and implementation. 

Inline CSS


Inline CSS is added as an attribute to any HTML element. The name of the attribute is style.

It is added like this:

<div style=" "></div>

In the inverted commas, you have to enter the property-value pairs, like this:

<div style="color: red"></div>

Internal CSS

Internal CSS is added as an HTML element under the HEAD tag of HTML web page. The name of the element is <style>.

It is added like this:

<html>
<head>
<style>
h1 {color: red;}
</style>
</head>

External CSS

External CSS is added as an HTML element under the HEAD tag of HTML web page. The name of the element is <link>.

It is added like this:

<html>
<head>
<link href="css/style.css" rel="stylesheet>
</head>
The location/address of your CSS file is entered in the href of the LINK element.

No comments:

Post a Comment