You are having max-width: 500px
property applied to container, iframe( 540px) and content section, so it extended to reach it’s max width on smaller screens. This is the matter of responsive. So change the max-with to 100% when the screen is smaller than 500px:
@media screen and ( max-width : 500px ) {
#content {
max-width: 100%
}
}
Next, the width of the ‘#content’ element is still exceed the view width because your box-sizing property by default is content-box
which mean the width is 100% + padding + border
px . Change it to border-box
instead, then the final CSS should be:
@media screen and ( max-width : 500px ) {
#content {
max-width: 100%;
box-sizing: border-box;
}
}