what are the default values of padding, border, and margin?
Answer
Depending on each browser those values will vary, therefore is commonly recommended to “reset” those values to 0 in a CSS file. Browsers provide default values for a general support for legible content, but sometimes they will get on your way. Another thing is that not all tags get the same default values for padding or margin, although the only default value for border is medium none currentcolor where medium is the thickness, none is the style, and currentcolor sets it to the color of the background.
Here is a list of common tags and their most common default values:
The unit px in CSS is an absolute unit meaning it does not change based on the size of the browser. On the other hand em is a responsive unit meaning it changes based the size of the parent element.
The best answer for this question would be in the Default Style Sheet of your browser. Look for any elements that do not have margin(s) set to zero. For instance, UL, OL, DL and/or LI; or, P which has a top/bottom margin (with collapsing enabled). Also look at padding. Stuff like that. Reset more or less wipes all that away and lets us set everything how we like.
Personally, I’m not a fan of ‘reset.css’, but then once we know how elements render without a style sheet (meaning using only the Default), we don’t need the file.
em helps with adaptive design more than it does ‘responsive’ since it scales proportionately as the user zooms in. However, in more recent years the PX unit demonstrates roughly the same behavior (when zooming in and out).
Responsive design centers more around device width and window dimensions. Ideally we would want to set up media queries to respond to the various device widths for smart phones, tablets, laptops, desktops and large screens. In other words the font size does not scale continuously but is set according to our media query rulesets. In all cases, the scale is 100%. Only when we zoom does the font size scale continuously.