pdf HTML 1
pdf HTML 1
Now you've learned about many more HTML elements! This page is a summary
of all the elements you've seen so far. You can use this page as a reference if
you forget how to use one of these elements in your code.
Block Elements
Block elements are used for large sections of text, such as paragraphs, headlines, or lists; and also
for some other features such as video players and tables.
A block element creates a (usually invisible) box in the browser display. By default, this box takes
up the full width of the display. The beginning of a block always starts on a new line in the display.
Most block elements have a particular way they are displayed by default: paragraphs have margins
around them; lists have bullet-points or numbered items; headlines are printed in large text. There
is also a generic block element, div, which has no special defaults.
● <p> — Paragraph.
Text in a paragraph is separated visually from other paragraphs by a small margin.
● <ul> and <ol> — Unordered and ordered lists.
By default, <ul> lists are displayed with bullet points, and <ol> lists with numbered items.
● <li> — List items inside a <ul> or <ol> list.
The <li> element has to be nested inside a <ul> or <ol> list; it can't occur on its own.
● Section headers, from <h1> (largest) to <h6> (smallest).
Used for headlines, section titles, and the like.
● <div> — A logical division of a page or document.
Other block elements such as paragraphs, lists, and headers can be nested inside a <div>.
You will see the <div> element much more in the next lesson. Because they don't have any
default display settings, divs are heavily used with custom styling with CSS.
version 1.0
Inline Elements
Inline elements do not create a full-width box on the display. They modify the display of text, or
insert other things into the text — such as line breaks, images, or hyperlinks.
Images
The alt text is used if the image can't be loaded, or if the user can't see images — such as if the
user is using a screen reader.
version 1.0
Links
Hyperlinks allow the user to navigate from one page to another. They are created using the a
element. The destination of the link is written in an attribute called href; the link text appears as
the contents of the a element. Here's an example:
<a href="https://en.wikipedia.org/wiki/Hypertext">
Wikipedia's "Hypertext" article
</a>
A link within a single web site can be written using a relative URL. Links to other sites must be
written as absolute URLs.
version 1.0