Class cannot be used in Div tag? Why | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 4

Class cannot be used in Div tag? Why

like this <div class=some name> and in css .some name{properties } not working why?

12th Mar 2018, 10:26 AM
Jay Jay
Jay Jay - avatar
13 Respuestas
+ 15
class = "some name" Use of the quotation marks is key
12th Mar 2018, 10:32 AM
Tarantino
Tarantino - avatar
+ 8
Don't use space for style class name, if there's a space in the class specification browser will think you're setting multiple classes for the div element.
12th Mar 2018, 11:11 AM
Ipang
+ 8
If you can show us your code then it will be easy for us to help.
12th Mar 2018, 12:06 PM
Nikhil
Nikhil - avatar
+ 7
I think spaces are not allowed in naming a class
21st Mar 2018, 2:12 PM
Prashanth Kumar
Prashanth Kumar - avatar
+ 3
seeing a lot of helping hands in this community shows I am right where I should be. awesome
11th Apr 2018, 1:22 PM
James
James - avatar
+ 2
Nice to be in this community.
16th Mar 2018, 6:43 AM
Olufemi Ajibade
+ 1
Write class name in double cot in div tag It will definately work
24th Mar 2018, 5:58 AM
Gursant Punia
Gursant Punia - avatar
+ 1
this is not right the way to assign name for the class you can use these mentioned formates please see inside the code. https://code.sololearn.com/WBG31v43vE40/?ref=app
3rd May 2018, 4:41 PM
Amit Sharma
Amit Sharma - avatar
+ 1
Spaces aren't allowed and use quotation marks with class name while using div tag Example: IN HTML:- <div class="somename">.....</div> And IN CSS:- .somename{ properties}
18th Jul 2019, 6:18 AM
Achal Saxena
Achal Saxena - avatar
0
delete space in class name and add double cot
25th Mar 2018, 2:44 PM
Anwer Nouri
Anwer Nouri - avatar
0
class can be used in div tag.If you are unable to do that it means you are making a mistake.
27th Mar 2018, 1:37 AM
tarun pandey
tarun pandey - avatar
0
here you have not used quotation marks like this <div class="something">
27th Mar 2018, 1:39 AM
tarun pandey
tarun pandey - avatar
0
yes like thes if the name have 2 words delete space or add (_) between words
27th Mar 2018, 9:19 PM
Anwer Nouri
Anwer Nouri - avatar