In the standard box model:
Ethan Marcott in Responsive Web Design, p. 35, wrote:
when setting up the flexible filling of an element, your context is the width of the element itself.
Take a look at the following example:
.main-wrapper {
width: 98%;
}
.box-one,
.box-two {
width: 44.791666666667%;
float: left;
margin: 30px 0 20px 0;
padding: 2.083333333333%;
text-align: center;
}
.box-one {
margin-right: 2.083333333333%;
background-color: red;
}
.box-two {
background-color: blue;
}
<div class="main-wrapper">
<div class="box-one">
<p>box one here</p>
</div>
<div class="box-two">
<p>box two here</p>
</div>
</div>
Run codeHide resultMy question is:
According to what is written in this book, setting up add-ons: shoudn't be correct (but it!).
padding: 2.083333333333%;
Instead of: We should consider the width of the element and 430px. But if we use this value as a context, we get 4.x%.
What will I not get here?
source
share