The background-color thing is a part of HTML only or CSS? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

The background-color thing is a part of HTML only or CSS?

9th Sep 2016, 7:05 AM
Mahima Gupta
3 Answers
+ 3
If you wanted, you could put everything (html+css+javascript) in a unique html file. The reason css exists is to separate style (how the elements of the page look) from structure (how they are organized). That said, background-color is a style property. You can modify that property on an element directly in the html, or in the css. Putting all the styling in the css is recommended, but modifying it in the html is okay if it's a single element. If you want to apply the same style properties to several elements, use css to avoid code repetition.
9th Sep 2016, 9:22 AM
Zen
Zen - avatar
0
css
9th Sep 2016, 7:33 AM
ivan
0
html and css
10th Sep 2016, 6:02 AM
Ariel Novoa
Ariel Novoa - avatar