tags seem to have a built-in margin, 8px for Firefox, Chrome, and Safari. While they are all consistent at 8px, it seems like this can change based on the browser vendor.
I want my page to take up 100vw and 100vh including the built-in margin, but am having trouble figuring out how to do this in a way that does not hardcode the margin. For instance:
.page-container{
width: calc(100vw - 16px);
height: calc(100vh - 16px);
}
This will make sure my page fills the view because the container's width + margin-left and margin-right = 100vw exactly, and same with the height. However, this relies on the built-in margin staying the same: 8px on all sides. If this changes for any reason it could make my page overflow or not fill the view.
Is there a way to rewrite this referencing the margin directly? Something like:
.page-container{
width: calc(100vw - <body>margin-left - <body>margin-right);
height: calc(100vh - <body>margin-top - <body>margin-bottom);
}
I searched w3schools and other css references but couldn't find this.