Hi,
We can set the padding and margin properties of an element E using either pixels or percentages.
A) I assume that when we use percentages, the percentage value refers to the width of the containing block? Thus, if E is declared directly inside <body>
element, then the containing block is <body>
and percentage value refers to width of <body>
element.
B) What is the default width of a <body>
element?
Thanks.
EDIT:
If I set E’s padding to 50%:
#E
{
padding: 50%;
}
then the width of E's "padding-left + padding-right" will equal the width of a viewport (when viewport is expanded over the entire screen).
A) Thus, I assume the width (specified in pixels) of <body>
depends on a horizontal resolution of a monitor and the width of a viewport? My screen resolution is set to 1024*768, and thus in my case the width of a <body>
is 1024px (assuming viewport is expanded over the entire screen) ? But if I was to change the resolution to 800*600, then the width of a <body>
would be 800px?