HTML Academy
Nested lists
Text markup6/21
Back to the list of tasks
  • 1. Let’s start the diary
  • 2. The ul tag, which is used to indicate an unordered list
  • 3. The ol tag, which is used to provide an ordered list
  • 4. The start and reversed attributes
  • 5. Nested lists
  • 6. The dl, dt and dd tags as well as description list
  • 7. The pre tag, which is used to designate preformatted text
  • 8. HTML entities
  • 9. The tag code, or code snippet
  • 10. Combining pre and code tags
  • 11. The tag q, which is used to format inline quotes
  • 12. The blockquote tag, which is used for calling out quotes
  • 13. The br tag, which is used to create a line break
  • 14. The sub and sup tags, which are used to indicate subscript and superscript
  • 15. The time tag, which is used to specify the date and time
  • 16. The em and i tags, which are used to attract the user’s attention
  • 17. The strong and b tags, which are used to strengthen or highlight text
  • 18. The del and ins tags, which are used to highlight changes
  • 19. The div and span tags, style containers
  • 20. Summary of “Text markup”
  • 21. Test: Marking up an article
The pre tag, which is used to designate preformatted text
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

The dl, dt and dd tags as well as description list

Here is a new blog entry about the “maladies” that coders are susceptible to. (Don’t worry! You won’t catch any of them if you are a diligent student in this course.) Each disease has a description, and some even have several such descriptions. The last list type (the description list) is the most suitable for marking up such information.

The description list is good for marking up questions and answers, terms and definitions, as well as categories and topics. It is created using three tags:

  • <dl> (short for “description list”) designates the description list itself;
  • <dt> (which is short for “description term”) designates the term;
  • <dd> (which is short for “description definition”) designates the description or definition.

The <dt> and <dd> tags are written within <dl>.

Each <dl> list can contain one or more terms and one or more descriptions for each term. Code example:

<dl>
  <dt>HTML</dt>
  <dd>Hypertext Markup Language</dd>
  <dt>CSS</dt>
  <dd>Cascading Style Sheets</dd>
  <dd>A language for formatting the presentation of HTML documents</dd>
</dl>

By default, the browser adds a small indent to the left of the definitions.

You might see <dl> referred to as an “association list” (which the current HTML specification calls it), or as a “definition list” (as it was called in the previous version of HTML). They all mean the same thing.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>The website of a beginning coder</title> <link rel="stylesheet" href="style.css"> </head> <body> <header> <p>Blog</p> <nav> Return to home </nav> </header> <main> <article> <h1>Day Four. How I almost got sick</h1> <p>Today I found out that it can be dangerous to be a coder. When you are just starting out, you are still inexperienced and can easily get infected by some sort of disease. Here are just some of the dangers that may be lying in wait for you:</p> <!-- Start the list of descriptions here --> Divatosis Acute fear of semantics Tablephobia Avoidance of tables A desire to format tables using divs Classitis The tendency to assign classes to every tag </article> <aside> Your ad could go here </aside> </main> <footer> Website footer </footer> </body> </html>
CSS
body { padding: 0 30px; font-size: 14px; line-height: 22px; font-family: "Georgia", serif; color: #222222; } h1 { font-size: 20px; line-height: normal; } nav { color: #888888; } aside { margin: 20px 0; color: #c4c4c4; }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. After the first paragraph add the description list <dl> to <article> and enclose the entire unmarked up text in it.
    2. Add the term <dt> with the text Divatosis and its description <dd> with the text Acute fear of semantics to the list.
    3. Then add the term with the text Tablephobia and its two descriptions with the texts Avoidance of tables and A desire to format tables using divs.
    1. You can use the tags <dt> and <dd> to mark up the remaining term and description <dl>.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.