Browser Defaults

body has a margin of 8px on all sides and will default to a font size of 100%. The body represents just about everything within the HTML and CSS documents providing the structure for a website. Anywhere from headings to paragraphs, images to lists, you name it, it will probably be in the body.

p is shorthand for “paragraph” and has a margin of 1em and the font size of 1em. This text is the meat of the page, likely paragraphs and descriptions of a topic. What you’re currently reading is the paragraph section of this blog! Whatever the typeface set’s default, baseline font is will be the font for the paragraph text.

h1 is also known as “heading 1” has a default font size of 2em to 2.5em, or over twice the size of the default text of a given typeface set, and has margin spacings of 0.67em from the start and end of the margins. This is used primarily as the main header of the website, and it is used for the most important information on a given page.

ul, or “unordered list”, has vertical margins of 1em and size of 1em. This is a selection of a grouping of listings created in the HTML document and is incredibly useful for organization and intuitive code.

li represents the “listings” in the aforementioned unordered list, or even an ordered list! They have margin and font defaults parented to the list they are attached to. This means that whatever setting is determined in the ul will translate to the li.

When an element has margin and/or padding, is it the same on all 4 sides (top, right, bottom, left) or different? Unless otherwise stated in the HTML as margin-top or padding-left, for example, and the code just shows margin or padding values, it will be the same on all four sides.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top