How to use class="one two" ?, Please give me example. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to use class="one two" ?, Please give me example.

CSS class

11th Aug 2019, 5:29 PM
Armando Nenosono
Armando Nenosono - avatar
4 Answers
+ 4
HTML: <div class = "c1 c2"> yay </div> CSS: .c1 { color: green; } .c2 { background: red; } It will have green text color & red background. Very complicated.
11th Aug 2019, 5:47 PM
Airree
Airree - avatar
+ 1
Any tag in HTML can have an id and a class attribute. You can use those to make JS and CSS to access certain tags, by 3 different main things: name (tag name) id class With name you can target any tags of the same name. You can for example specify every paragraph element <p></p> to be red. id is an identifier for a tag, not 2 tags can have the same identifier, but you can use it to specify 1 certain element. class is a group for a tag, similar to id, but same class can be given for multiple individual elements.
11th Aug 2019, 8:12 PM
Seb TheS
Seb TheS - avatar
+ 1
Airree thx
11th Aug 2019, 11:26 PM
Armando Nenosono
Armando Nenosono - avatar
+ 1
11th Aug 2019, 11:27 PM
Armando Nenosono
Armando Nenosono - avatar