HTML Tags and Attributes Quiz
20 Questions
0 Views

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 tag is used for creating a line break without starting a new paragraph?

  • <hr>
  • <break>
  • <br> (correct)
  • <line>
  • Which tag is used to define bold text?

  • <bold>
  • <em>
  • <b> (correct)
  • <strong>
  • Which attribute is NOT part of the tag?

  • size
  • color
  • style (correct)
  • face
  • What does the


    tag create in an HTML document?

    <p>A horizontal line</p> Signup and view all the answers

    Which tag would you use to emphasize text?

    <em> Signup and view all the answers

    What does the bgcolor attribute do in HTML?

    <p>Changes background color</p> Signup and view all the answers

    Which tag defines small text?

    <small> Signup and view all the answers

    What is the purpose of the tag in HTML?

    <p>To define teletype text</p> Signup and view all the answers

    What is the purpose of the href attribute in an HTML anchor element?

    <p>Defines the hyperlink address</p> Signup and view all the answers

    Which tag is used to specify the height of an image in HTML?

    <img height='value'> Signup and view all the answers

    What does the <th> tag represent in an HTML table?

    <p>Table heading cell</p> Signup and view all the answers

    Which attribute is used to define the horizontal space around an image in HTML?

    <Hspace> Signup and view all the answers

    What does the <tbody> tag define in an HTML table?

    <p>The body of the table</p> Signup and view all the answers

    What attribute can be used in the <img> tag to provide alternative text for an image?

    <p>alt</p> Signup and view all the answers

    Which of the following tags is correctly used to add a caption to an HTML table?

    <caption>Caption</caption> Signup and view all the answers

    Which tag is used to create a form in HTML?

    <form> Signup and view all the answers

    What does HTML stand for?

    <p>Hyper Text Markup Language</p> Signup and view all the answers

    What is the primary purpose of the <HEAD> tag in an HTML document?

    <p>To provide metadata and links to scripts and stylesheets</p> Signup and view all the answers

    Which of the following correctly represents a closed heading tag using HTML?

    <H1></H1> Signup and view all the answers

    Which of the following is true about HTML tags?

    <p>HTML uses both opening and closing tags for container elements.</p> Signup and view all the answers

    Study Notes

    Introduction to HTML

    • HTML stands for Hyper Text Markup Language.
    • It's used to create web pages.
    • HTML is not a programming language, but a markup language.
    • markup languages use tags to describe web pages.
    • HTML documents contain HTML tags and plain text.
    • HTML is not case sensitive.

    HTML Elements and Tags

    • A tag is enclosed in angle brackets like <HTML>.
    • HTML tags usually come in pairs: start tag (e.g., <HTML>) and end tag (e.g., </HTML>).
    • Start tags are also called opening tags.
    • End tags are also called closing tags.

    How to Start

    • Write HTML code in a text editor (e.g., Notepad).
    • Save the file with a .html or .htm extension.
    • Open the file in a web browser (e.g., Internet Explorer, Netscape Navigator).
    • Web browsers read HTML documents and display them as web pages.

    Code with HTML

    • Example HTML code structure demonstrating how to create documents. <HTML><HEAD><TITLE>MY FIRST PAGE</TITLE></HEAD><BODY>GLOBAL INFORMATION CHANNEL</BODY></HTML>

    Explanation of Tags

    • <HTML>: Describes the HTML web page for display by a browser.
    • <HEAD>: Defines the header section of the page.
    • <TITLE>: Shows a caption in the title bar of the page.
    • <BODY>: Displays the contents of the web page.

    Types of HTML Tags

    • Container elements: Contain both a start tag and end tag (e.g., <HTML>).
    • Empty elements: Contain only a start tag (e.g., <BR>).

    Text Formatting Tags

    • Heading elements: Six heading elements (

      to

      ). Used to structure headings with decreasing importance.
    • is the largest heading. -

      is the smallest heading.
    • All heading elements are container tags.

    Heading Tag Code

    • Example of the HTML code using different heading tags

    Result of Heading Code

    • Example of the output of the provided code (the headings printed in different sizes).

    HTML Paragraph Tag

    • <p>: Defines a paragraph.
    • <pre>: Defines preformatted text that appears exactly as it’s typed. HTML will not interpret any changes in the formatting.

    Line Break & Horizontal Line Tag

    • <br>: creates a line break.

    • <hr>: Defines a horizontal line.


    • &


      are empty HTML elements.

    Text Formatting Tags (Further Examples)

    • Numerous text formatting tags are available for different formatting tasks. Example are:
    • <b>: Defines bold text.
    • <i>: Defines italic text.
    • <u>: Defines underlined text.
    • <s>: Defines Strikethrough text.
    • <sub>: Defines subscripted text.
      • <sup>: Defines superscripted text
      • <big>, <small>, <em> and <strong>

    Text Formatting Code

    • Examples of the HTML code using different formatting tags

    Result of Text Formatting Code

    • Examples of the output of provided HTML format code

    Font Tag

    • Used to format the size, typeface, and color of text.
    • Common typefaces include Arial, Times New Roman, etc.
    • Size attribute values range from 1 to 7.

    Background & Text Color Tag

    • <body bgcolor="color">: Sets the background color of the page.
    • <body text="color">: Defines the text color.

    Text Alignment Tag

    • <align="left">, <align="right">, <align="center">: Defines alignment of text.
    • Hyperlinks are references to resources on the web.
    • The <a> tag defines hyperlinks and anchors.
    • The href attribute specifies the link address. Example: <a href="http://www.example.com">Visit Website</a>

    Image Tag

    • <img src="url">: Displays an image.
    • <img src="url" width="x" height="y">: Sets the width and height of the image.
    • alt="text": Adds alternative text that is displayed if the image does not load.

    Image Attributes

    • <img> tag attributes are used to define image properties (e.g., alignment, size, and alternative text).

    Code & Result of the Image

    • Example images with HTML formatting showing how to utilize image tags.

    HTML Table Tag

    • <table>: Used to create tables.
    • <tr>:Defines a table row
    • <td>: Defines a table cell
    • <th>: Defines a header cell in a table.
    • <colgroup>: Defines group of table columns.
    • <caption >: Provides a caption for the table.
    • <Colspan>: The number of columns a cell spans.
    • <rowsapn>: The number of rows a cell spans.
    • Table attributes (e.g., border, cellspacing, cellpadding).

    Code & Result of the Table

    • Example HTML code for creating tables.
    • HTML header tags (e.g., <h1> to <h6>)

    Table Code with Colspan & Rowspan

    • Example HTML code demonstrates the use of colspan and rowspan attributes in tables. These attributes allow cells to span multiple columns or rows.

    Table Code with Caption & ColSpacing

    • Example HTML showing how to use captions and spacing to style the table.

    Cellpadding, Image & Backcolor Code

    • Example showing how to manipulate cellpadding, images and background colors in HTML tables

    HTML List Tag

    • Lists are used to display items sequentially. Three main list types are outlined:
    • Unordered lists with bullet points (<ul><li> ... </li></ul>).
    • Ordered lists with numbered items (<ol><li> ... </li></ol>).
    • Definition lists which present terms and their definitions together in a key-value pair format (<dl><dt><dd></dd></dt></dl>).

    List Tags

    • <li>: Represents list items.

    • <ul>: Defines an unordered list.

    • <ol>: Defines an ordered list.

    • <dl>: Defines a definition list.

    • <dt>: Defines a term (an item) for

      . (defines the term)

    • <dd>: Defines a description for the element in

    Unordered List

    • <ul type="type">: Use the type attribute with ul to specify different bullet styles. (e.g., disc, circle, square).

    Ordered List

    • <ol type="type">: Use the type attribute with ol to specify different numbering styles. (e.g., 1, a, A, i, I).

    Code & Result of the Unordered List and Ordered List

    • Example code that shows how to use lists, with numbered and bulleted lists in HTML structure.

    HTML Form

    • Forms allow users to enter input into the web page.
    • <form>: Defines a form.
    • Various input types (<input>, <textarea>, <select>, <button>, etc.) that allow users to enter data.

    Form Tags

    • Numerous form tags exist to handle user input, which are used to create the elements of a web form. Example:
    • <input type="text">: A single-line text input.
    • <textarea></textarea>: A multi-line text input area.
    • <input type="password">: A password field, where entered characters appear as asterisks. -<input type="radio">: A radio button
    • <select>: A selection list
    • <button>: A push button

    Code of the HTML Form

    • Example code for creating a form (e.g., with text input fields, a password field, a selection list).

    Result of the HTML Form

    • Example of the form as it would be displayed to the user (with form fields like text input, checkboxes, etc.)

    Studying That Suits You

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

    Quiz Team

    Related Documents

    Description

    Test your knowledge on HTML tags and their attributes with this engaging quiz. You will encounter questions that cover a wide range of topics within HTML, including line breaks, text formatting, and tag functionalities. Perfect for beginners and those looking to refresh their skills.

    More Like This

    HTML Tags Short Answer Questions
    5 questions
    HTML Tags Quiz
    5 questions

    HTML Tags Quiz

    ReasonableLithium avatar
    ReasonableLithium
    HTML Tags Quiz
    11 questions

    HTML Tags Quiz

    CozySunstone avatar
    CozySunstone
    Use Quizgecko on...
    Browser
    Browser