I
I
Islam Ibakaev2017-02-17 16:21:17
css
Islam Ibakaev, 2017-02-17 16:21:17

Do the min-height, min-width, max-height, max-width properties always have a fixed value?

As far as I understand the values ​​of these properties are always set in pixels.
Are there situations where they are given in relative terms?
If yes, can you show an example.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artyom, 2017-02-17
@devellopah

However, it's acceptable to set min-height and height when the values ​​are different units:
#example {
  min-height: 3em;
  height: 138px;
}

Here, the min-height declaration is based on em, which means that at some stage (due to text resizing) the em height may be larger than the 138px height we've set. In cases such as this, the element will be allowed to expand further than the 138px height, thus accommodating the resizing of the em-based text.

reference.sitepoint.com/css/min-height
https://developer.mozilla.org/en/docs/Web/CSS/max-...
https://css-tricks.com/almanac/properties/m/ max-height/
Lots of info.

S
Sergey Goryachev, 2017-02-17
@webirus

I love Friday questions.
Of course, you can use it, and sometimes you even need to.
But to sit and think "How can this be applied?" not for fun.
If you don't need it, why ask at all?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question