Answer the question
In order to leave comments, you need to log in
Is there a "correct" layout?
Hello.
Is there any "correctness" in the layout?
That is, I noticed that many use the classes wrapper, row and so on. By myself, I know how to typeset, but it annoys me that I can do something wrong. In general, is there any sense in the classes (I'm in terms of the comfort of the site, its SEO)?
Answer the question
In order to leave comments, you need to log in
The meaning of naming and structuring CSS classes is the same as the meaning of naming and structuring variables and functions in programming. Keeping the code in a logical, understandable and therefore easily maintainable state.
A universal rule, if there is no conscious path, is to use the BEM methodology and name the element according to the semantic load.
Not .bigBlackButton
because the button is big and black, but .sendNudesButton
because the button sends nudes.
.wrapper
, .row
etc. These are universal utility classes, they are often used when, for example, some kind of wrapper is needed for the sake of a wrapper or something that does not play a role in the structure of the document.
As for the technical and user side, correctness lies in respecting the HTML specification (the right semantic tags in the right places, correct nesting, etc.) and maintaining accessibility for visually impaired users (everything on the page can be done using the keyboard, all components documents are spoken correctly in voice assistants).
There is no concept of "correct" layout. The more you type, the better your layout will be. In the end, you will still have your own style and your own vision of what is right, as it should be.
Every manufacturing process has a methodology. You can work according to a well-known methodology, and then your code will be clear to those who own it, or not burden yourself with this and rivet as God puts it on your soul. It all depends on the scale of the project, its objectives and the further level of support. I don’t know what the experts wrote above, to be honest, I’m too lazy to read, but personally I recommend you read about the sieses methodology. This is the notorious BEM and SMACSS and others. They cover both class naming and project structuring and approaches to layout itself. The very application of the methodology, when justified, is undoubtedly a plus and is a professional approach that is necessary in production development. If you rivet landing pages and business cards, then, in my opinion, the methodologies are redundant for such goals.
Just open the Google site, look at the layout. Is it clear what is responsible for what? Yes, and it should not be clear, it does not matter, since there are more important things in development than coming up with class names.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question