+ 2
if i write for ex h1 tag before p tag in html .should i write in css code the same order:h1 selector before p selector???
17 Answers
+ 2
It's not important...
We can do any elements first unorderd
ones i made
h1{color:blue;}
p{color:red;}
body{background-color:aqua;}
but it worked
+ 2
Sonic
Abrar
Nithin Prabhu
but in my code when i put h4 selector in the last ,the style doesn't apply to it.
+ 1
That's not necessary
0
in my code it doesn't work when i change the order.
0
Ok please insert your code let me see
0
h4 element doesn't have its style which i insert
0
Save your code to playground and make it public and share it instead of sharing it in fragments.
0
Aya Khalid
I had made a h4 element and cut paste your CSS code for h4
And suprisingly it was working well.
Post you code in playground to make analysis better
0
Divya Mohan
i have saved my code to playground and insert it in the post.
but the style for h4 element doesn't work when i write it in this order of my css code.
0
Close the body and HTML tag altast in HTML
</body>
</html>
0
Don't try to style irrelevant things you don't have in pages.
use properly empty and closed tags of html
https://code.sololearn.com/WILLj8iY55L6/?ref=app
0
Divya Mohan
i think the problem(but i don't know what is this) is in the part you make it a comment as these things which you think are irrelevant i already use it but i insert only small part of my html code as it's very long.
0
Post whatever you actually have 😀😀
Don't post it in fragments bro.
It's make things complicated.
0
The best way to access specific html element is using its id instead of class or name . With this "h1:p" you refer to all p elements inside the h1 tag and if you use only "p" it refers to all paragraph element in your html page
0
Salaruddin Jalal
but what's the problem if i use the class attribute to apply the style?
- 1
No
- 1
No that is not necessary