HTML Academy
HTML tags
Introduction to HTML and CSS3/13
Back to the list of tasks
  • 1. What is HTML?
  • 2. HTML tags
  • 3. Tag nesting
  • 4. Tag attributes
  • 5. What is CSS?
  • 6. Change the values of the CSS property
  • 7. Let’s change the properties in the CSS rules
  • 8. Create your own CSS rule
  • 9. Apply the styles by class
  • 10. Let’s use two classes
  • 11. Let’s redefine the styles
  • 12. Let’s finish setting up the styles
  • 13. Summary of “Introduction to HTML and CSS”
Tag attributes
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Tag nesting

Now Muffin is satisfied. He really liked the updated design; he even purred. But additional changes can be made to this good design: we can add text, insert an image and play with fonts and spacing. You did a good job of fixing the website, and now you must add the finishing touches.

To do this, we will start with revising the text. The boss needs to add another paragraph to the section “Why choose me?” and to add one more item to the list “What will you learn?”

Paragraphs are added using the <p> tag, and list items are added using the <li> tag. These tags should be inserted inside other tags, so we will discuss the rules of nesting in more detail.

Other tags can be inserted inside paired tags. For example, this is true of lists:

<ul>
  <li>List item</li>
</ul>

Nested tags always need to follow the correct closing order. A nested tag cannot be closed after a parent tag:

<ul><li>List item</ul></li> <!-- Bad  -->
<ul><li>List item</li></ul> <!-- Good -->

Furthermore, not all tags can be nested inside other tags. For example, the tag <h1> that you are already familiar with cannot be nested inside <p>. You will gradually learn these nesting rules for each tag as you learn HTML.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Instructor Muffin</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="container"> <header class="site-header"> <h1>Instructor Muffin</h1> <p>Training for beginner kittens</p> </header> <section class="features"> <h2>Why choose me?</h2> <p>I myself was once a kitten. But look at me now.</p> <p>I have got the master fully trained.</p> <!-- Add a paragraph here --> </section> <section class="skills"> <h2>What will you learn, you may ask?</h2> <ul class="skills-list"> <li>How to snatch food from the master’s plate</li> <li>How to give furniture a vintage look</li> <li>How to open the door and not go in</li> <li>How to wake the master up at night</li> <!-- Add a list item here --> </ul> </section> <footer class="site-footer"> <p>© Muffin, 2019</p> <p>I don’t have any contact information, but I can find you myself.</p> </footer> </div> </body> </html>
CSS
body { padding: 0; font-family: "Arial", sans-serif; font-size: 14px; line-height: 18px; color: #000000; background: #ffffff url("img/muffin-background.jpg") no-repeat 50% 0; } h1 { width: 260px; font-family: "Arial", sans-serif; font-size: 36px; line-height: 36px; } .site-header { margin-bottom: 190px; } .skills-item { margin-bottom: 5px; } .container { width: 480px; margin: 0 auto; } .site-header img { display: block; margin: 0 auto; } .features { margin-bottom: 30px; } .features p { display: inline-block; vertical-align: top; width: 30%; margin: 0 5px; background-repeat: no-repeat; background-position: center top; text-transform: uppercase; } .feature-kitten { padding-top: 60px; background-image: url("img/bottle.svg"); } .feature-cat { padding-top: 60px; background-image: url("img/cat.svg"); } .feature-train { padding-top: 60px; background-image: url("img/whistle.svg"); } .skills-list { padding: 0; } .site-footer { display: flex; justify-content: space-between; color: #999999; }

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. Add a third paragraph with the text I have been a full-time professional cat for more than 5 years now. to the section “Why choose me?”
    2. And add a fifth list item with the text How to scatter fur around the apartment to the section “What you will learn”.

    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.