HTML Basics Quiz

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of the <!DOCTYPE html> declaration in an HTML document?

  • It is used to include external scripts.
  • It marks the end of the HTML document.
  • It defines the language of the document.
  • It indicates the version of HTML being used. (correct)

Which of the following elements is used to create a clickable hyperlink?

  • <link>
  • <hyperlink>
  • <a> (correct)
  • <anchor>

When defining an image in HTML, what attribute is used to specify the file destination?

  • src (correct)
  • alt
  • href
  • image

What does the alt attribute in an image tag provide?

<p>A description if the image fails to load. (C)</p> Signup and view all the answers

Which HTML element would you use to create a numbered list?

<ol> (A) Signup and view all the answers

What is the purpose of comments in HTML?

<p>To leave notes for developers that are not displayed in the browser. (B)</p> Signup and view all the answers

Which tag is used to define a paragraph in HTML?

<p> (D) Signup and view all the answers

What does the target attribute in an anchor tag specify?

<p>How the link opens in a browser. (A)</p> Signup and view all the answers

Flashcards are hidden until you start studying

Study Notes

HTML Basics

  • HTML Definition: Hypertext Markup Language is the standard language for creating web pages.

  • Structure of HTML Document:

    • Doctype Declaration: <!DOCTYPE html> - indicates the document type and version.
    • HTML Element: <html> - root element that contains all other elements.
    • Head Element: <head> - contains meta-information, links to stylesheets, scripts, and the title.
    • Body Element: <body> - contains the content of the web page, such as text, images, and links.
  • Basic Syntax:

    • HTML elements consist of tags, which are enclosed in angle brackets (e.g., <tagname>).
    • Most elements have an opening tag and a corresponding closing tag (e.g., <tagname></tagname>).
  • Attributes:

    • Provide additional information about elements.
    • Syntax: <element attribute="value">.
    • Common attributes: id, class, style, src, href.
  • Comments:

    • Used to leave notes in the code, not displayed in the browser.
    • Syntax: <!-- Comment here -->.
  • Text Formatting Elements:

    • <h1> to <h6>: Headings (h1 is the largest, h6 is the smallest).
    • <p>: Paragraph.
    • <strong>: Bold text.
    • <em>: Italicized text.
  • Lists:

    • Ordered List: <ol> - numbered list.
    • Unordered List: <ul> - bullet list.
    • List Item: <li> - defines a list item.
  • Links (Hyperlinks):

    • Defined using the <a> tag (anchor tag).
    • Syntax: <a href="URL">Link Text</a>.
      • href: specifies the URL the link points to.
      • target: can specify how to open the link (e.g., _blank for new tab).
  • Images:

    • Added using the <img> tag.
    • Syntax: <img src="imageURL" alt="description">.
      • src: the source of the image file.
      • alt: alternative text for the image.
  • Forms:

    • <form>: used to collect user input.
    • Common elements include <input>, <textarea>, <select>, and <button>.

HTML Overview

  • HTML: Stands for Hypertext Markup Language; it's the standard markup language for web page creation.

Structure of HTML Document

  • Doctype Declaration: <!DOCTYPE html> signifies the document type and version of HTML being used.
  • HTML Element: The root element is <html>, which encapsulates all other elements in the document.
  • Head Element: <head> includes meta-information about the document, like <title>, links to stylesheets and scripts.
  • Body Element: <body> contains the actual content of the webpage such as text, images, and links.

Basic Syntax

  • HTML elements consist of tags wrapped in angle brackets (e.g., <tag>).
  • Most elements have an opening and a closing tag (e.g., <tag>...</tag>), forming a structure.
  • Attributes: Offer additional details about elements, formatted as attribute="value".
  • Common attributes include id, class, style, src, and href.

Comments

  • Used for leaving notes within the code for developers; not shown in the browser.
  • Syntax for comments is <!-- Comment here -->.

Text Formatting Elements

  • Headings: Created using <h1> to <h6>, where <h1> is the largest and <h6> is the smallest.
  • Paragraph: Defined using <p>.
  • Text styles include <strong> for bold and <em> for italicized text.

Lists

  • Ordered List: Created using <ol>, produces a numbered list.
  • Unordered List: Created using <ul>, produces a bulleted list.
  • List Item: Defined with <li> within either list type.
  • Formed using <a> (anchor tag).
  • Syntax: <a href="URL">Link Text</a>.
  • The href attribute specifies the target URL, while target can control link opening behavior (e.g., _blank opens in a new tab).

Images

  • Included with the <img> tag.
  • Syntax: <img src="imageURL" alt="description">.
  • The src attribute denotes the source file, while alt provides alternative text for the image.

Forms

  • <form>: Utilized for collecting user input.
  • Common form elements include <input>, <textarea>, <select>, and <button>.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

More Like This

HTML Basics Quiz
8 questions

HTML Basics Quiz

EnergyEfficientHedgehog avatar
EnergyEfficientHedgehog
HTML Fundamentals for Web Development
16 questions
Introduction to HTML Basics
8 questions

Introduction to HTML Basics

ThinnerMulberryTree avatar
ThinnerMulberryTree
Introduction to HTML Basics
15 questions
Use Quizgecko on...
Browser
Browser