M
M
MisTFoR2020-05-06 00:54:08
css
MisTFoR, 2020-05-06 00:54:08

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

5 answer(s)
O
origami1024, 2020-05-06
@origami1024

The correct layout most often means semantic .

I
itsjustmypage, 2020-05-06
@itsjustmypage

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 .bigBlackButtonbecause the button is big and black, but .sendNudesButtonbecause the button sends nudes.
.wrapper, .rowetc. 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).

O
Oleg Smirnov, 2020-05-06
@sovaz1997

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.

V
Vaultboy84, 2020-05-06
@Vaultboy84

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.

P
profesor08, 2020-05-06
@profesor08

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 question

Ask a Question

731 491 924 answers to any question