0
I have a question today regarding CSS
Sometimes it is more feasible to put CSS code directly in the HTML tag and I wonder if this is a bad practice
How do I proceed with this doubt? It’s really bad? I do it on time and then I move to an external sheet?
Thanks
It depends on the context. If it is a CSS that will only be used on that page, there is no problem. It saves a request including. If it goes to multiple pages, separately you have the benefit of caching, and reuse. In specific situations you can put the CSS in the element itself as well. The important thing is to know the pros and cons. This is the kind of thing that when one does only one way, or does not understand the subject (the follower of good practices), or does not actually work with it to the point of having only done very elementary things. There’s no way to cut through, you have to understand.
– Bacco
I didn’t quite understand if the question is about CSS in tags
<style>
, on the attributestyle
, or both.– bfavaretto
It refers to style attributes
– Pedro Soares