+ 4
What is the difference between vh and px and percent
Help
3 Réponses
+ 10
1vh is equal to 1% of the viewport's height, with the viewport being the browser window. 1px is one physical pixel on the device's screen. Percent is the relative size compared to its parent element. For example, a div with 50% width inside another div will take up half of the outer div's width.
Vh and percent are both relative units, so they scale based on some factor of the device it is viewed on. Pixels are absolute, so a 100x100 pixel image will be larger on a low resolution screen, but very small on a screen with high pixel density.
+ 2
So what is different between view port and percent 😨