Fix: correct the width of main and footer #130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The widths of the elements
main
andfooter
was broken (narrower thanheader
andnav
) because the width was only776px
instead the800px
ofheader
andnav
and in contrast toheader
andnav
main
andfooter
have a padding for their content which is part of the width calculation.So the
main
andfooter
boxes had (as first issue) not the same width asheader
andnav
and had (as second issue) a resulting width of814px
when the rule for the box width saidwidth: 800px;
because the7px
forpadding-left
andpadding-right
got added to the800px
of the width-rule.The correction was done with changing the box model to border-box (which includes paddings and border-widths in the width calculation for the element). Additionally the width rule for the direct childs of body was moved to a descendent selector for all these elements.
Attention The descendent selector would select also every direct child of
body
that will possibly introduced in the future.