+ 2

Differences between # and . In CSS

Hi guys, When i was reading and looking through some examples of css on sololearn, some program they use uses # and some . May i know the difference? Eg: .p{} And #body{}

3rd Nov 2018, 10:20 AM
Ryan Chandra
Ryan Chandra - avatar
2 Antworten
+ 1
n the CSS, a class selector is a name preceded by a full stop (“.”) and an ID selector is a name preceded by a hash character (“#”). The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one. http://www.htmldog.com/guides/css/intermediate/classid/
4th Nov 2018, 10:26 AM
deepak sharma
deepak sharma - avatar