HTML Tags and Attributes

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

Which HTML tag is used to create a table?

  • <td>
  • <tr>
  • <header>
  • <table> (correct)

The tag is used to create columns in an HTML table.

False (B)

What is the purpose of the tag in an HTML table?

To define header cells in a table.

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

<p>To hold metadata about the document (B)</p> Signup and view all the answers

To create an ordered list in HTML, use the _____ tag.

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

The tag is used to define elements that are displayed on a web page.

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

Match the following HTML tags with their functions:

<ol> = Creates an ordered list <ul> = Creates an unordered list <li> = Defines a list item <caption> = Defines a title for a table Signup and view all the answers

What is the significance of using quotes around attribute values?

<p>Quotes indicate the start and end of the attribute value.</p> Signup and view all the answers

The <____> tag is used to create a new paragraph in an HTML document.

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

Which of the following is a paired tag?

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

Match the following HTML tags with their descriptions:

<h1> = Defines the most important heading <h6> = Defines the least important heading <p> = Creates a paragraph <pre> = Displays preformatted text Signup and view all the answers

HTML lists can only be unordered.

<p>False (B)</p> Signup and view all the answers

Which tag is considered an empty tag?

<p><br> (B)</p> Signup and view all the answers

What is the main purpose of using the tag in HTML tables?

<p>To provide a title or description for the table.</p> Signup and view all the answers

Each item in an ordered or unordered list is defined by the _____ tag.

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

Several values can be assigned to an attribute without any special characters.

<p>False (B)</p> Signup and view all the answers

What are heading tags also known as?

<p>Text Appearance Tags</p> Signup and view all the answers

Which HTML tag is primarily used to create a hyperlink?

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

What attribute is necessary for an anchor tag to work correctly?

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

The
tag is a paired tag.

<p>False (B)</p> Signup and view all the answers

What are the two most common attributes used in the tag?

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

Character entities in HTML start with an ampersand '&' and end with a ______.

<p>semi-colon</p> Signup and view all the answers

Match the following HTML components with their descriptions:

<p><img> = Displays an image <br> = Creates a line break <b> = Renders text in bold <i> = Renders text in italic</p> Signup and view all the answers

Which of the following is NOT a common accepted file type for images in HTML?

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

What is the purpose of using emojis in messaging?

<p>To express feelings and reactions</p> Signup and view all the answers

Flashcards are hidden until you start studying

Study Notes

HTML Attributes

  • Attributes modify or enhance HTML tags and are placed within the start tag, following the tag name.
  • Attribute values can be enclosed in single or double quotes.
  • Multiple values can be assigned to an attribute, separated by commas.

Core HTML Tags

  • Key HTML tags include <html>, <head>, and <body>.

The <html> Tag

  • The <html> tag is a paired tag that indicates the beginning and end of an HTML document.

The <head> Tag

  • The <head> tag contains metadata and is typically not displayed.
  • Elements such as <title>, <meta>, and <link> can be included for document information.

The <body> Tag

  • The <body> tag contains all visible content on a web page.
  • It encapsulates other HTML tags that are rendered when the page is viewed in a browser.

Formatting Text and Images

  • Headings define titles/subtitles, with <h1> being the most important and <h6> the least important; they are bold and have margins by default.
  • The <p> tag creates a paragraph that starts a new line; excess whitespace is ignored.
  • The <pre> tag preserves whitespace and formatting from the source code.
  • The <br> tag inserts a line break without starting a new paragraph.

Formatting Tags

  • Basic formatting can be done using tags like <b> for bold, <i> for italic, and <u> for underline.

Linking Web Pages

  • The <a> tag (anchor element) creates hyperlinks to other web pages or iframes.
  • The href attribute specifies the URL for navigation.

Adding Images

  • The <img> tag displays images, with commonly accepted formats including png, jpeg, and gif.
  • Key attributes for <img> include:
    • src: path to the image.
    • alt: alternative text for loading failures.
    • title: text displayed on mouse hover.
    • width & height: dimensions of the image.

Using Entities

  • Character entities represent reserved characters in HTML and begin with an ampersand (&) and end with a semicolon (;).
  • Named entities can be used directly; unnamed entities use numeric codes.

Introducing Emojis

  • Emojis are image-like texts used for expression in messaging and have HTML entities for representation.

Tables and Listings

  • HTML allows the creation of tables using <table>, <tr>, <th>, <td>, and <caption> tags.

Creating a Table

  • A table is defined using the <table> tag, which encapsulates rows (<tr>) and columns (<td>).

Adding Rows and Columns

  • Rows are added with the <tr> tag, which can contain multiple <td> tags for columns.
  • Each <td> tag is used to define cells within the row.

Adding Headers

  • Table headers can be defined using the <th> tag within <tr>, improving the organization of table data.

Listing Tags

  • HTML supports ordered lists (numbered) and unordered lists (bulleted) to group related items.
  • Ordered lists use <ol>, while unordered lists utilize <ul>.

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 Attributes and Tags
8 questions

HTML Attributes and Tags

BelovedSnowflakeObsidian avatar
BelovedSnowflakeObsidian
HTML Tags and Attributes Quiz
129 questions
HTML basics quiz
19 questions

HTML basics quiz

IndebtedOwl avatar
IndebtedOwl
HTML Basics: Tags, Attributes and Structure
29 questions
Use Quizgecko on...
Browser
Browser