HTML Tags and Attributes Quiz

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

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 (D)</p> Signup and view all the answers

Which tag would you use to emphasize text?

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

What does the bgcolor attribute do in HTML?

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

Which tag defines small text?

<p><small> (A)</p> Signup and view all the answers

What is the purpose of the tag in HTML?

<p>To define teletype text (A)</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 (B)</p> Signup and view all the answers

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

<p><img height='value'> (A)</p> Signup and view all the answers

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

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

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

<p>&lt;Hspace&gt; (B)</p> Signup and view all the answers

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

<p>The body of the table (B)</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 (C)</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> (D) Signup and view all the answers

Which tag is used to create a form in HTML?

<form> (B) Signup and view all the answers

What does HTML stand for?

<p>Hyper Text Markup Language (D)</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 (D)</p> Signup and view all the answers

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

<H1></H1> (D) 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. (B)</p> Signup and view all the answers

Flashcards

What is HTML?

HTML stands for Hyper Text Markup Language. It's used to create the structure and content of web pages.

What is a markup language?

A markup language uses tags to define the structure and content of a document. HTML is a markup language.

What are HTML tags?

HTML tags are enclosed in angle brackets (<>) and typically come in pairs. For example, <p> (opening tag) and </p> (closing tag) define a paragraph.

What does the <HTML> tag do?

The <HTML> tag represents the root element of the HTML document. It indicates the start and end of the entire HTML code.

Signup and view all the flashcards

What does the <HEAD> tag do?

The <HEAD> tag defines the header section of the HTML document. It contains information that is not displayed directly on the page, such as the document's title.

Signup and view all the flashcards

What does the <TITLE> tag do?

The <TITLE> tag defines the title of the HTML document. This title appears in the browser's title bar and tab.

Signup and view all the flashcards

What does the <BODY> tag do?

The <BODY> tag defines the body section of the HTML document. It contains the content of the page that is visible to the user.

Signup and view all the flashcards

What are heading elements in HTML?

The heading elements (

-

) are used to define headings for different levels of importance.

is the largest heading, while

is the smallest.

Signup and view all the flashcards

tag

A tag which defines bold text. For example, <b>This text is bold.

Signup and view all the flashcards

tag

A tag which defines emphasized text. For example, <em>This text is emphasized</em>.

Signup and view all the flashcards

tag

A tag which defines italic text. For example, <i>This text is italic</i>.

Signup and view all the flashcards

tag

A tag which defines text that is smaller in size. For example, <small>This text is small</small>.

Signup and view all the flashcards

tag

A tag which defines deleted text. For example, <del>This text is deleted</del>.

Signup and view all the flashcards

tag

A tag which defines inserted text. For example, <ins>This text is inserted</ins>.

Signup and view all the flashcards

tag

A tag which defines subscript, placing text below the baseline. For example, <sub>This is subscript</sub>.

Signup and view all the flashcards

tag

A tag which defines superscript, placing text above the baseline. For example, <sup>This is superscript</sup>.

Signup and view all the flashcards

How to change text color

Changes the color of the enclosed text.

Signup and view all the flashcards

Text Alignment Tag

Aligns text in a web page. Options include left, right, and center.

Signup and view all the flashcards

Hyperlink

A reference to a resource on the web, such as an image, video, or another webpage.

Signup and view all the flashcards

Image Tag - 'src' Attribute

The attribute that specifies the URL of the image to display on the page.

Signup and view all the flashcards

HTML Table Tag (

)

Used to create tables in web pages.

Signup and view all the flashcards

Table Elements (

,
, )

Different elements used within a table to organize data and create a header row.

Signup and view all the flashcards

HTML Form

An area on a web page that allows users to input information.

Signup and view all the flashcards

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

More Like This

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

HTML Tags Quiz

CozySunstone avatar
CozySunstone
HTML Tags and Classifications
10 questions

HTML Tags and Classifications

ProlificDoppelganger avatar
ProlificDoppelganger
Use Quizgecko on...
Browser
Browser