New course! Every coder should learn Generative AI!
Try a free lesson0
can i put style inside of the text styling tag? example: <b style="color:red"> bold text</b> is it allowed to do that?
3 Answers
+ 3
Yes, this is called inline css. Anyway note that though in small web pages you can use it without take cure of it, in large pages its good practice NOT use it because it make more hard to mantain pages. Try to keep separate content (html) from presentation (css).
Futhermore inline css have max priority respect to external and with style tag (this mean that if you declare same css prop on same element in different way, inline get priority)
+ 1
YEP !
+ 1
which one is better to do, use span or just put style inside the tag?
example:
(a) <p>This is an
<span style="color:red">
<b>important</b>
</span>message
</p>
(b)<p>This is an
<b style="color:red">important
</b>message
</p>