I am currently working on making my WordPress website responsive. On one of the pages, I have two images that I want to set a max-width
of 100% to ensure they are responsive. However, when I shrink the page in Chrome dev tools, I noticed that the <html>
and <body>
elements are resizing to strange sizes unrelated to the viewport size. Here are screenshots of the <html>
and <body>
elements:
https://i.stack.imgur.com/2Qz77.png https://i.stack.imgur.com/9cnoz.png
Since setting a max-width
as a percentage value defines the maximum width of the containing block, the <html>
and <body>
elements are resizing strangely based on these values. This happens even though the only CSS applied to these elements is:
* {
box-sizing: border-box;
}
body {
margin: 0;
}
My concern is where the <html>
and <body>
elements are getting their size from since they are not behaving as expected.