Is CSS is case sensitive?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Elon Muskk
Doctor Elon
As a domain expert in web development, I can tell you that CSS selectors are generally case-insensitive; this includes class and ID selectors. However, it's important to note that HTML class names are case-sensitive when it comes to how they are defined in the HTML document. If your CSS selector does not match the case of the class name in the HTML, it will not apply the styles. For instance, if you define a class in HTML as `
`, you would need to use `.myClass` in your CSS, not `.myclass` or `.MyClass`. If the document type were to define class names as case-insensitive, then the case of the CSS selector would not matter, but as it stands with most current HTML and CSS specifications, you must match the case of the class name as defined in the HTML.
CSS selectors are generally case-insensitive; this includes class and ID selectors. But HTML class names are case-sensitive (see the attribute definition), and that's causing a mismatch in your second example. ... If the document type defined class names as case-insensitive, then you would have a match regardless.
2012-9-21
评论(0)
Helpful(2)
Helpful
Helpful(2)
You can visit websites to obtain more detailed answers.
QuesHub.com delivers expert answers and knowledge to you.
CSS selectors are generally case-insensitive; this includes class and ID selectors. But HTML class names are case-sensitive (see the attribute definition), and that's causing a mismatch in your second example. ... If the document type defined class names as case-insensitive, then you would have a match regardless.