CSS (Cascading Style Sheets)
To add Styles to HTML
Styles-->adding colors,fonts,size,borders etc..,
Css is not a programming language.Css is not a Markup language either.
CSS is a Style Sheet Language. CSS is a rule-based language.
How to define Style for HTML Elements
1.In Line
<h1 style="color:red"> Priya </h1>
2.By Using Style Tag:
<html> <head> <style type="text/css"> h1{ color:blue; } </style> </head> <h1> Boopathi </h1>
3.keep separate CSS file
name as
Style.CSS
h1{color:red}
name as
index.html
<html> <head> <link rel="stylesheet" href="styles/style1.css"> </head> <h1> Priya </h1>
4.Basic Structure Of CSS
tagname{ property:value; }
eg.
h1{color:red;}
5.CSS comments = (/* Comments*/)
6.code: html
<html> <head> <link rel="stylesheet" href="styles/style1.css"> </head> <h1> Priya </h1> <p> This is the book </p>
code: css
h1{ color:red; font-size: 5em; } p{ color:black; }
Multiply Property values: code: html
<html> <head> <link rel="stylesheet" href="styles/style1.css"> </head>…