Answer the question
In order to leave comments, you need to log in
Why a huge number of classes in the html tag?
Hello, while studying the layout, I came across the site https://deviceatlas.com/ . After reviewing the code with a firebug, the question immediately arose, why are so many classes assigned to the html tag? Why are they needed and what do they mean? I can’t even formulate a question in Google, please help a newbie figure it out)
Answer the question
In order to leave comments, you need to log in
This library puts these classes: https://modernizr.com/
Article on Habré: Modernizr: practical application , most likely outdated, but the essence will help to understand.
The library not only adds classes depending on the capabilities of the browser, but also replaces the "no-js" class with "js", thus allowing the developer to determine if the user has JavaScript enabled. This can be used, for example, to prevent users without JavaScript enabled from showing buttons that won't work without it:
.no-js .my-button {
display: none;
}
As a beginner, I will immediately say that you do not need to do this. If the site is not very popular (like search engines and major portals), then IE users must suffer . You should not try to make their life easier by compatibility with junk - this is a road to nowhere.
If the user cannot install Firefox for himself, or kick the admin, then these are his personal problems. The page must function, but does not have to conform to the layout.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question