Markup Basics - HTML Tutorial
In this chapter you'll learn the HTML elements you'll use on almost every page you build. Each section includes short examples that you can try in your html-practice folder.
Before you start, you should be comfortable creating an HTML file, editing it and viewing it in your browser. If you're not, work through Chapter 1, Getting Started first.
By the end of this chapter, you'll be able to:
- set up the
headof a page properly - organize text with headings, paragraphs and line breaks
- mark up important, emphasized and specialized text
- change text and background colors
- link to other pages and to sections within a page
- add images that load quickly and are accessible
- create bulleted, numbered and description lists
Sections in This Chapter
- The Head Element
-
Set up the information every page needs: title, character encoding, viewport, description and style sheet links.
- Paragraphs and Line Breaks
-
Break your text into readable paragraphs, and learn when (and when not) to use a line break.
- Headings
-
Give your page a clear outline with heading levels
h1toh6. - Formatting Text
-
Mark up words and phrases with elements such as
strong,em,markandcode, and learn the difference between inline and block elements. - Colors
-
Set text and background colors using color names, hex codes,
rgb()andhsl(), while keeping text easy to read. - Links
-
Understand URLs, link to other sites and your own pages, and jump to sections within a page.
- Images
-
Add images with useful alternative text, choose the right file format and help pages load smoothly.
- Lists
-
Create unordered, ordered and description lists, and nest lists inside one another.