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>.
<html>
<head>
<style></head>
h1 {color: red;}</style>
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>The location/address of your CSS file is entered in the href of the LINK element.
<head>
<link href="css/style.css" rel="stylesheet></head>
Comments
Post a Comment