E
E
E1brus2022-04-18 21:17:35
HTML
E1brus, 2022-04-18 21:17:35

Div or Ul tags?

Almost every site has cards with brief descriptions about the effectiveness of services or pluses, but that's not the point)

Most people design them using divs - some even go so far as to have each element in the card be a separate div within a div heh, so what is the question you ask me, so I’m telling you:

I saw in one video from the frontend course how a certain team leader from the Mos exchange site team decided to make cards through a list and not div, that is ...

<div>
    <ul>
        <li>
            <h4>Название</h4>
            <img href="" alt="">
        </li>

        <li>
            <h4>Название</h4>
            <img href="" alt="">
        </li>
    </ul>
</div>


Instead of my usual

<div class="main-div">
    <div>
        <h4>Название<h4> 
        <img href ="" alt ="">
    </div>

    <div>
        <h4>Название<h4> 
        <img href ="" alt ="">
    </div>
</div>


Which option would be better? even if it depends on tastes, which one will be more correct to use? to further try to develop that option and practice?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2022-04-18
@firedragon

Think for yourself
In your example, a list of cards, so why should it be formatted in some kind of div?
a div is just a container without a logical load, the list, on the contrary, indicates that this is a collection of a certain type, possibly with a certain structure, and you don’t spend money on it, everything is out of the box

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question