<link rel="stylesheet" href="style.css">
Internal
<style>
p {
color: blue;
}
</style>
<p>Internal Styling</p>
inline
<p style="color: cadetblue;">This is Inline CSS</p>
External
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p>External Styling</p>
</body>
</html>
style.css
p{
color: coral;
}
selector{
property: name;
property: name;
...............
}
We can directly use the html element tags to target that specific element
<h1>Hello</h1>
, we use:h1{
color:rgb(24, 60, 83);
font-size: 50px;
}
This h1{ …. }
selects all the h1 elements in the document.
So, in order to avoid that, we use class=”NameOfClass”
or id=”UniqueID”
id=”UniqueID”
and to select that id element we use: #title{…….}
#title{
color:rgb(189, 132, 25);
font-size: 50px;
}
<h1 id="title">Hii</h1>
class=”NameOfClass”
and to select that class elements we use: .headings{……}
.headings{
color:rgb(199, 23, 61);
font-size: 50px;
}