+ 1

Can we interchange the #and. | For id and class

#intro { Color:red; Background-color:green; } .Test { Color:green; Background-color:red; } <div id="intro">... <div> <div class="Test">... <div>

29th Apr 2017, 4:34 PM
SHUBHAM PANCHAL
SHUBHAM PANCHAL - avatar
4 Answers
+ 3
You can interchange it.. as long as you follow the following rules: Each id can only occur once. Whereas class can occur one or many times.
29th Apr 2017, 4:39 PM
CalviŐ˛
CalviŐ˛ - avatar
+ 2
use both. when you know the style going to be reused then use class, otherwise use id.
29th Apr 2017, 4:48 PM
CalviŐ˛
CalviŐ˛ - avatar
+ 1
Thank you calvin
29th Apr 2017, 4:47 PM
SHUBHAM PANCHAL
SHUBHAM PANCHAL - avatar
0
Thank you
29th Apr 2017, 4:50 PM
SHUBHAM PANCHAL
SHUBHAM PANCHAL - avatar