If i have some object in css with height: 45%; how to create same width? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 4

If i have some object in css with height: 45%; how to create same width?

If i have some object in css with height: 45%; how to create same width? Sorry for my English.

9th Aug 2019, 6:00 PM
Tonik Horkel ą² _ą² 
Tonik Horkel ą² _ą²  - avatar
2 Respostas
+ 2
If your 45% is the window height's 45%, you can just use '45vh'. It will be the 45% of the screen height, even when used on width
9th Aug 2019, 6:02 PM
Airree
Airree - avatar
+ 4
You can use something called "vmin" , or "vmax" (1 of them for both width and height) vmin is the smaller size of the screen. If your screen height is smaller than its width, then vmin ==vh , or if your screen width is smaller than your screen height, then vmin == vw. The same (but inverted) applies to vmax. I hope you understand. šŸ˜Š
9th Aug 2019, 8:39 PM
šŸ‡ Alex Tușinean šŸ’œ
šŸ‡ Alex Tușinean šŸ’œ - avatar