Time to dive into learning about all the different tags for creating content! This page contains a helpful table of tags to know for beginning programmers to bookmark. This is by no means an exhaustive list of all HTML tags, but it is a good place to start.
Tags to Know
|Bold||When surrounding text, makes that text bold.|
|Emphasis||When surrounding text, makes that text italic.|
|Break||A single line break.|
|Paragraph||Creates a paragraph in text.|
|Section||Makes a section in text.|
|Division||Defines an area of the page.|
|Form||Creates a form for user input.|
|Unordered List||Creates an unordered list.|
|Ordered List||Creates an ordered list.|
|List element||Denotes an element of the list. This tag is used for both ordered and unordered lists.|
|Table||Creates a table on the page.|
|Heading Level One||Creates a heading in the text.|
There are multiple headings in HTML going from
h1 is the top-level heading,
h2 is a sub-heading of an
h1, and so on. By default, the headings get progressively smaller as the heading level goes up.
A good rule of thumb is to have only one
h1 in a web page and to not skip a level as you add sub-headings. Resist the temptation to use the heading level to change the size of a given heading. The appearance of a heading should be changed using CSS. We will learn how to do this in the next chapter.
Here is an example of a basic web page utilizing some of the tags above with the HTML used to make the site.
Programmers can add extra information beyond element type to HTML tags. Programmers add attributes to HTML tags for further specification about the element’s appearance. Examples of attributes include the alignment of the element or alternate text to an image.
Programmers add attributes before the closing bracket in the opening tag, like so:
<element attribute = "value">content</element>
Here is an example of a basic web page utilizing some of the tags above and appropriate attributes with the HTML used to make the site.
<img> tag has two attributes that you will see a lot.
src gives the
location of the image that is being used and
alt gives alternate text for
screen reader users. For that reason,
alt should be a concise description
of what is going on in the image.
Check Your Understanding
Which tag is used to make text italicized?