S
S
sunnyrio2019-02-17 20:01:46
css
sunnyrio, 2019-02-17 20:01:46

How to set container height by content at specific resolution?

There is a container with a given height: 400px; how to make that with a certain media query the height value of this container becomes dependent on the content? (height: auto??)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Talyan, 2019-02-17
@sunnyrio

When the window width is less than 768px:

@media (max-width:768px)
{
.elementclass {
height: auto;
}
}

Added at the end of CSS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question