<style type="text/css">
p
{
Font-family:Arial;
}
Label
{
Font-family:Arial;
}
</style>
- Do you think that was the right way sure its correct but its not dynamic if we want to make all the paragraphs and labels and maybe <h1> headers and alot alot do you think this is the best way
<html>
<head>
<style type="text/css">
.myclass */ its very important to put dot before the name
{
Font-family:Arial;
}
</head>
<body>
<p class="myclass"> helloooooo</p>
<h1 class="myclass">it has the same font family of hellooooo</h1>
<label class="myclass">and this too :) Imagine :D</label>
</body>
</html>- now what if we want to let only a specific element to has it unique class just like humans elements in websites can have ID too so if we give each element an ID and then in our style file say make this style available only for the element of that ID lets see this example :
<head>
<style type="text/css">
#text
{
padding:100px;
font-size:20px;
color :red;
}
</style>
<body>
<p id="text"> hello</p> */ so only this paraghrap which has a unique ID will get that style in our css style
</body>
</html>
i hope its fine till now.
what if we want to use various classes for the same object or tag its not that complicated lets see
<html>
<head>
<style type="text/css">
p.color
{
color: FFFFFF */white color
}
p.font
{
font-size:20%;
font-family:Romani;
}
</style>
<body>
<p class="color"> how are you guys i hope you like my lessons</p>
<p class="font">i'd love to share me your questions and i'll do my best to answer it</p>
</body>
</html>
No comments:
Post a Comment