+ 2
If we want to style some paragraphs or headlines by our choice in html,so how can we use class attribute to apply
5 odpowiedzi
+ 4
Use global class attribute in html tag
Html
<p class="p">. </p>
<h1 class="p"> </h1>
Css
.p{
Your style goes here
}
+ 4
You can put your css code inside <style> tag in both body and head.
But preferred place is head.
In my 1st example both p and h1 share same class name.
Suppose you are going to change the color.
So select both with class selector
.p{
color:red
}
+ 4
Oh i got the point you are telling about inline style.
It is possible with style attribute.
<p style="color:red" > it is a paragraph </p>
Style attribute can contain any css property.
or
<html>
<head>
<style>
.p{
color:red
}
</style>
</head>
<body>
<p> it is a paragraph </p>
</body>
</html>
+ 2
Md Sayed 🇧🇩🇧🇩
1.Where can we use our style set at head or body?
2.Can u tell me that I will declare my style set after paragraph or headline?
+ 1
Md Sayed 🇧🇩🇧🇩
I mean can u tell me the structure direct in html without css?