C
C
CoolBatman2732018-06-27 19:16:08
css
CoolBatman273, 2018-06-27 19:16:08

How can I make an element's width equal to its neighboring element if the width cannot be fixed?

The structure is like this:
<div>div+ul>li>img+span</div>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
skuvaWeb, 2018-06-27
@skuvaWeb

If the parent is set to display: flex; then child elements will default to the same height (smaller ones stretch to the tallest)

P
profesor08, 2018-06-27
@profesor08

Flexbox will help solve the problem
https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question