Answer the question
In order to leave comments, you need to log in
Semantics, markup, naming. What does the ideal markup look like?
Are there any examples of markup close to the standard? What will you spit on or how to do it for no reason?
To more specific questions:
- Is there a difference between p and span?
In terms of SEO, in terms of perception and maintainability?
For example, which looks better:
<div class="white-section__header">
<h2 class="white-section__title">Title text</h2>
<span class="white-section_text">Some text.</span>
</div>
<div class="white-section__header">
<h2 class="white-section__title">Title text</h2>
<p class="white-section_text">Some text.</p>
</div>
<section class="consultation">
<div class="container">
<div class="consultation__inner">
<div class="consultation__items">
<div class="consultation__head-indent white-section__header">
<h2 class="white-section__title">Title text</h2>
<span class="white-section__text">Some text</span>
</div>
<div class="consultation__form">
<form>
<div class="consultation__form-box">
<div class="form-box__left">
...
</div>
<div class="form-box__right">
...
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
position: absolut;
top: 15px;
Answer the question
In order to leave comments, you need to log in
1. p
- for a set of paragraphs, if this is not it, then you can safely take span.
2. Classes on p → perfect, except for user input.
3. Class strictly according to BEM (well, almost).
4. Flexbox really should not be thoughtlessly abused, as there is always a risk of shooting yourself in the foot.
5. PP → in the layout it is worth looking for patterns and releasing them, but checking for overflow, since user input is not dormant.
6. position: absolut;
→ position: absolute;
7. Padding is entirely dependent on the context, for example, if you need to make a card with a background color, then most likely you will apply padding so that there are padding from the edges.
I only use div, span and list. Well, there are little things a, img. Because all this semantics is needed not for design, but for the text on the site. And if this is a site design, then all sorts of p and others are simply not needed. And if you make websites yourself, then do what is more convenient for you. For example, I myself sometimes come up with tags, for example, <mytag></mytag>
to group elements. Silly, but I'm more comfortable
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question