In How is padding calculated when using percentage (%)? was stated, that padding
is calculated according to parent's width.
I now have the following assignment CSS-Code
.img_tutorial_full_width
{
background-color : #3E3E42;
margin : 0;
border : 0;
padding : 1%;
width : 99%;
}
which I would expect, when applied to an <img>
-Tag like this:
<img class="img_tutorial_full_width" src="../img/example.jpg"></img>
to stretch the container over the whole width, since
margin=border := 0 + padding := 1% + content := 99% = 100%
However, the browser shows scrollbars, that are increasing, the wider the window is. Where is the conceptual mistake?