Skip to content

Instantly share code, notes, and snippets.

@prestidigitation
Last active April 5, 2017 21:18
Show Gist options
  • Save prestidigitation/558993a47eca10742134fdd3f141ce54 to your computer and use it in GitHub Desktop.
Save prestidigitation/558993a47eca10742134fdd3f141ce54 to your computer and use it in GitHub Desktop.
Phase 0 2.2 Release 2
1. What is a block-level element? What are some examples of block-level elements? What are they used for?
A block-level element occupies the entire space of its parent element (a.k.a. container), thereby constituting a "block". Examples of block-level elements include: <nav> <form> <div> <pre>.
<nav> Used for a section of a page that links to other pages or parts within the page.
<form> Document section that contains interactive controls to submit info to a web server.
<div> Generic container for flow content and doesn't inherently represent anything. Used for such things as grouping elements for purposes such as styling.
<pre> Represents preformatted text, typically displayed in a monospace font exactly as laid out in the file.
2. Can you find any good charts or resources on when you should use these elements? For example, when might you use a div versus a section?
MDN, the Mozilla developer network site has good resources on when each different element should be used.
https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
3. What is an inline element?
An HTML elements that only occupies the space bounded by the tags the define it. Generally only contain data and other inline elements. Examples include <a> <img> <object> <button>
4. Do inline elements usually nest inside block-level elements, or is it typically the other way around?
In general in-line elements nest inside block-level elements, since block-level elements tend to be considered "larger". The binary distinction between block-level and in-line has been superseded by content categories in HTML 5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment