Hello,
Is there any reason why I should not use hyphens or underscore in css class names (class="example_1-2") or id names (id="example_1-2")?
Thank you,
Chris
Printable View
Hello,
Is there any reason why I should not use hyphens or underscore in css class names (class="example_1-2") or id names (id="example_1-2")?
Thank you,
Chris
None that I know of. I use the underscore/hyphen all the time. Just remember do not start an ID name with a number! It will not work in Mozilla/Firefox. Do not start a class name with a number! This is only supported in Internet Explorer. Haven't verified if these exceptions are still a problem in the latest browsers.
I dont think so because i used lot of hyphen and underscore in my site css
According to http://www.webdesignerdepot.com/2009...ove-your-code/, "Older browsers like to get glitchy with underscores in CSS, or don’t support them at all. For better backward compatibility, get into the habit of using hyphens instead."