Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

Summary

In this lesson, we learned that:

  • Attributes are written in the opening tag in the form name="value", always with the value in quotes.
  • The id attribute identifies an element, so its value must be unique on the page. Every page should also have the lang attribute on the html element.
  • Links are created with the a element (anchor) and its href attribute, whose value is the address the link leads to.
  • A link with the target attribute set to _blank opens in a new tab.
  • Addresses can be absolute, e.g. https://www.wikipedia.org/, or relative, e.g. ./dog.html.
  • A relative address starting with ./ looks for the file in the same folder as the HTML file with the link.
  • A relative address starting with / looks for the file in the root folder of the project.
  • Images are added with the img element, which has no content and no closing tag. Its src attribute holds the address of the image and alt a description, which screen readers read out and browsers show when the image can't be loaded. A purely decorative image gets alt="".
  • Videos are added with the video element and its src attribute. The boolean attribute controls turns on the control buttons. The content of the element is shown only by browsers that can't play video.
  • An image (or another element) placed inside a link becomes a link too.
  • A link can lead to a part of the current page: the value of href is # followed by the id of the element. A link to just # leads to the top of the page.
  • The elements header, nav, main, section and footer say what each part of the page is, while div only groups elements together.

In this lesson, we learned how to add images and videos, how to use links and what attributes are, and we gave our page a meaningful structure. In the next lesson, we will learn how to create tables in HTML.

Instructions

  1. 1

    Congratulations on completing the lesson on advanced HTML elements! The editor contains your final code from this lesson. Now you can customize the page with your new knowledge.

Back

14/14

  1. 1. Attributes
  2. 2. Links
  3. 3. Quiz: Links
  4. 4. Opening Links in a New Tab
  5. 5. Relative Links
  6. 6. Images
  7. 7. Quiz: Images
  8. 8. Image Accessibility
  9. 9. Videos
  10. 10. Images as Links
  11. 11. In-Page Links
  12. 12. Page Structure
  13. 13. Main Content and Sections
  14. 14. Summary
Next

Try it yourself

Do this exercise right here in your browser. No account needed.