How do we know that how many pixels in width:100% and width:100vw ?
Situation
body{
width:100%;
}
.container{
width:1000px;
}
How do i get exact value ?
balanceWidth = bodywidth - containerwidth
I know about css calc width: calc(100% - 1000px); , I need to get exact pixel value
For this:
balanceWidth = bodywidth - containerwidth
You can use calc method:
width: calc(100% - 1000px);
When you have 1000px wide element you assume the percentage wide is 100% and for 1% you can calculate taking 1000px dividing by 100.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With