I “kind of” knew what block elements were but I thought that I should research them. Searching the net I think I have found some good definitions. Basically there are 3 types of elements you can have on a page.
- Not Displayed
A block-display element will span the full width of the space available to it, and so will start on a new line in the flow of HTML. The flow will continue on a new line after the block-display element.
To define an element as a block you can do it in CSS by typing:
Common HTML elements that are naturally block-display include:
- <h1> … <h6>
- <ul>, <ol>, <dl>
- <li>, <dt>, <dd>
Inline-display elements don’t break the flow. They just fit in with the flow of the document.
To define an element as an inline you can do it in CSS by typing:
More elements are naturally inline-style, including:
- <img />
Can you imagine a “<a>” tag being a BLOCK element? I can’t. That would suck if all links had to be on a new line all by themselves!
Some tags, like <meta /> and <style> are not visible