Introduction to HTML

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 does HTML stand for?

  • High-level Text Management Language
  • Hyperlink Transfer Management Language
  • Hyper Text Markup Language (correct)
  • Home Tool Markup Language

What is the primary function of HTML?

  • To style web pages
  • To add interactivity to web pages
  • To manage server-side operations
  • To define the structure of a web page (correct)

Which of the following tags is used to define the most important heading in HTML?

  • `<h6>`
  • `<h2>`
  • `<h1>` (correct)
  • `<h3>`

What tag is used to define a paragraph in HTML?

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

Which tag is used to create a hyperlink in HTML?

<p><code>&lt;a&gt;</code> (A)</p>
Signup and view all the answers

What is the purpose of the href attribute in an <a> tag?

<p>To specify the URL the link goes to (B)</p>
Signup and view all the answers

What is the correct HTML element for inserting a line break?

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

Which HTML element is used to define emphasized text?

<p><code>&lt;em&gt;</code> (D)</p>
Signup and view all the answers

Which HTML element is used to define important text?

<p><code>&lt;strong&gt;</code> (A)</p>
Signup and view all the answers

What is the correct HTML for creating an unordered list?

<p><code>&lt;ul&gt;</code> (D)</p>
Signup and view all the answers

In HTML, what does the <div> element typically represent?

<p>A division or a section in an HTML document (A)</p>
Signup and view all the answers

Which of the following is a structural element in HTML5?

<p><code>&lt;header&gt;</code> (D)</p>
Signup and view all the answers

What is the purpose of the <table> element in HTML?

<p>To display data in rows and columns (D)</p>
Signup and view all the answers

Which HTML tag is used to define a table row?

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

Which HTML tag is used to define a table header cell?

<p><code>&lt;th&gt;</code> (C)</p>
Signup and view all the answers

Which attribute is used to make a cell span across multiple columns in an HTML table?

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

Within an HTML table, which tag is used to define the table body?

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

In HTML, which tag is used to define the table header?

<p><code>&lt;thead&gt;</code> (A)</p>
Signup and view all the answers

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

<p>It specifies the HTML version being used (B)</p>
Signup and view all the answers

HTML stands for Hyper Text Makeup Language.

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

HTML describes the structure of a web page.

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

The <body> tag contains the page's metadata.

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

Browsers display HTML tags to the user.

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

All HTML elements must have both a start tag and an end tag.

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

HTML elements can be nested within each other.

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

The <html> element is the root element of an HTML page.

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

HTML attributes provide additional information about HTML elements.

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

The href attribute in an <a> tag specifies the image source.

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

Block-level elements are displayed inline by default.

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

A <p> element is a block-level element.

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

Inline elements start on a new line.

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

The <h1> tag defines the least important heading.

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

HTML paragraphs are defined with the <paragraph> tag.

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

The <blockquote> element is used to display emphasized text.

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

The <a> tag is used to define hyperlinks.

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

An absolute link points to another website.

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

In HTML lists, the <li> tag is used to define a description.

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

The <div> element is a container for other HTML elements.

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

The <footer> element typically contains the main content of the page.

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

Flashcards

What is HTML?

A standard markup language used for creating web pages, describing the structure of a webpage using elements.

What are Web Browsers for?

Read HTML documents and display them correctly, interpreting HTML tags to determine how content is shown.

HTML Document structure

They must start with a document type declaration: <!DOCTYPE html>. The <html> tag is the root element.

What is an HTML Element?

Defined by a start tag, content, and an end tag. Elements tell the browser how to display the content.

Signup and view all the flashcards

Nested HTML Elements

HTML elements can be placed inside other elements. The <html> element is the root, containing <head> and <body>.

Signup and view all the flashcards

HTML Attributes

Provide additional information about HTML elements, specified in the start tag, usually in name/value pairs (e.g., name="value").

Signup and view all the flashcards

Block-level Element

An element that always starts on a new line and takes up the full width available. Examples include <p> and <div>.

Signup and view all the flashcards

Inline Element

An element that does not start on a new line and only takes up as much width as necessary. An example is <span>.

Signup and view all the flashcards

HTML Headings

Titles or subtitles on a webpage, defined using <h1> to <h6> tags, where <h1> is the most important.

Signup and view all the flashcards

HTML Paragraphs

Defined with the <p> tag, used to structure text into distinct blocks.

Signup and view all the flashcards

HTML

Defines a section that is quoted from another source, often indented by browsers. Use the cite attribute to specify the source URL.

Signup and view all the flashcards

HTML Links

Create hyperlinks to navigate between pages. Defined with the <a> tag and the href attribute to specify the link's destination.

Signup and view all the flashcards

Absolute link

Type of HTML link that specifies the full address to another website. Example: https://yahoo.com

Signup and view all the flashcards

Relative Link

Type of HTML link that links to other documents on the same website. Example: index.html

Signup and view all the flashcards

HTML Line Break Element

Forces the next element or text to display on a new line.

Signup and view all the flashcards

tag

Displays text in bold font, indicating importance.

Signup and view all the flashcards

HTML Lists

HTML lists that allows web developers to group a set of related items in lists.

Signup and view all the flashcards

Unordered HTML List

An unordered list, marked with bullets, using the <ul> tag and <li> for list items.

Signup and view all the flashcards

Ordered HTML List

An ordered list, marked with numbers, using the <ol> tag and <li> for list items.

Signup and view all the flashcards

HTML Div Element

An tag that is used as a container for other HTML elements; by default, it is a block element that takes all available width.

Signup and view all the flashcards

HTML Entity Characters

Special characters in HTML, like quotes or copyright symbols, represented by codes.

Signup and view all the flashcards

HTML link - href attribute

The href attribute specifies the URL of the page the link goes to.

Signup and view all the flashcards

Mailto link

HTML link that creates a clickable email address, opening the user's email client.

Signup and view all the flashcards

Tel link

A specific type of HTML link that creates a clickable phone number, useful for mobile devices.

Signup and view all the flashcards

Used to define structural sections in a webpage, containing main navigation.

Signup and view all the flashcards

Element

Used to define structural sections in a webpage, containing the main content

Signup and view all the flashcards

Element

Used to define structural sections in a webpage, containing the headings of a document.

Signup and view all the flashcards

Element

Used to define structural sections in a webpage, containing the footer information..

Signup and view all the flashcards

HTML Tables

HTML structure composed of rows and columns, used to display data.

Signup and view all the flashcards

Tag

HTML tag used to define a title for an HTML table.

Signup and view all the flashcards

Tags

HTML tag Pair that add row and column headings to an HTML table.

Signup and view all the flashcards

Colspan Attribute

attribute makes a cell span across multiple columns in a HTML table.

Signup and view all the flashcards

Rowspan Attribute

attribute makes a cell span over multiple rows in a HTML table.

Signup and view all the flashcards

Tag that represents a table body, grouping together the main set of table rows.

Signup and view all the flashcards

tag

Tag that represents a table heading, describing the columns below.

Signup and view all the flashcards

tag

Tag that represents a table footer, summarizing or clarifying information in the table.

Signup and view all the flashcards

Valid HTML Benefit

Validation tools confirm code is correct for consistent display.

Signup and view all the flashcards

Study Notes

  • HTML stands for Hyper Text Markup Language
  • HTML is the standard markup language for creating web pages
  • HTML describes the structure of a web page
  • HTML consists of elements that tell the browser how to display content
  • HTML elements label pieces of content like headings, paragraphs, and links

Simple HTML Document

  • HTML documents begin with <!DOCTYPE html>.
  • The HTML document starts with <html> and ends with </html>.
  • The visible part of the HTML document is between <body> and </body>.
  • The content inside the <body> section will be displayed in a browser
  • The content inside the <title> element will be shown in the browser's title bar or in the page's tab.

HTML Elements

  • An HTML element is defined by a start tag, some content, and an end tag:
  • <tagname>Content goes here...</tagname>
  • The HTML element is everything from the start tag to the end tag: <h1>My First Heading</h1>
  • Certain HTML elements lack content, such as the <br> element, and are termed empty elements, thus not requiring closing tags.

Web Browsers

  • Web browsers (Chrome, Edge, Firefox, Safari) read HTML documents and display them correctly
  • Browsers use HTML tags to determine document display, but do not show the actual tags themselves

Special Entity Characters

  • Special characters like quotes and the copyright symbol can be displayed using entity codes
  • &copy; displays the copyright symbol ©

Nested HTML Elements

  • HTML elements can be nested, meaning an element can contain other elements.
  • All HTML documents consist of nested HTML elements
  • Example of nested elements:
    • <html> <body> <h1></h1> <p></p> </body> </html>
  • The <html> element is the root element and defines the whole HTML document with start and end tags, containing a <body> element.

HTML Attributes

  • HTML attributes provide additional information about elements and are specified in the start tag
  • Attributes follow a name="value" format
  • The <a> tag defines a hyperlink, its href attribute specifying the URL to which a link navigates: <a href="https://www.google.com">Visit google</a>
  • The <img> tag may include width and height attributes specifying image dimensions: <img src="img.jpg" width="500" height="600">

Block and Inline Elements

  • Every HTML element has a default display value, depending on its type

Block-Level Elements

  • Block-level elements always start on a new line, with browsers automatically adding some space (margin) before and after the element
  • Example: <p> <div>
    • <p> defines a paragraph in an HTML document
    • <div> defines a division or a section in an HTML document

Inline Elements

  • Inline elements do not start on a new line and take up only as much width as necessary
  • Example: <span>Hello World</span>

HTML Headings

  • Display titles or subtitles on a webpage via heading tags
  • Headings are defined with the <h1> to <h6> tags.
    • <h1> defines the most important heading
    • <h6> defines the least important heading
  • Example:
    • <h1>This is heading 1</h1>
    • <h2>This is heading 2</h2>
    • <h3>This is heading 3</h3>

HTML Paragraphs

  • Paragraphs are defined with the <p> tag
  • Example:
    • <p>This is a paragraph.</p>
    • <p>This is another paragraph.</p>

HTML Quotations

  • The <blockquote> element defines a section that is quoted from another source
  • Browsers usually indent <blockquote> elements
  • The <a> tag creates hyperlinks to allow users to navigate
  • Links are defined with the <a> tag:
  • Absolute links point to other websites <a href="https://yahoo.com">Yahoo</a>
  • Relative links point to pages on your own site: <a href="index.html">Home</a>
  • <a> can create links for email addresses and phone numbers
  • The mailto: protocol creates a link that opens the default email client with the specified email address pre-filled: <a href="mailto:[email protected]">This is a link</a>
  • The tel: protocol creates a clickable phone number link on mobile devices: <a href="tel:+97470070070">Call Us</a>

HTML Line Break Element

  • <br> creates a line break and is a stand-alone tag
  • In HTML5 it is called a void element
  • Causes the next element or text to display on a new line

HTML Horizontal Rule Element

  • <hr> configures a horizontal line and is a void element
  • Should indicate a thematic break at the paragraph level in HTML5

HTML Phrase Elements

  • Indicate the context and meaning of the text and display inline with the text

  • <b></b> - This text is displayed in bold font

  • <strong></strong> - This text has strong importance and is displayed in bold

  • <i></i> - This text is displayed in italic font

  • <em></em> - This text has emphasis and is displayed in italic font

HTML Lists

  • HTML lists allow web developers to group a set of related items in lists
    • Unordered Lists
    • Description Lists
    • Ordered Lists

Unordered HTML Lists

  • An unordered list starts with the <ul> tag and each list item starts with the <li> tag
  • The list items are marked with bullets (small black circles) by default:
  • Example:
    • <ul> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul>
    • Result:
    • Coffee
    • Tea
    • Milk

Ordered HTML Lists

  • An ordered list starts with the <ol> tag and each list item starts with the <li> tag
  • The list items are marked with numbers by default
  • Example:
    • <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol>
    • Result:
      1. Coffee
      1. Tea
      1. Milk

HTML Description Lists

  • A description list is a list of terms, with a description of each term
  • The <dl> tag defines the description list
  • The <dt> tag defines the term (name), and the <dd> tag describes each term
  • Example:
    • <dl> <dt>Coffee</dt> <dd>black hot drink</dd> <dt>Milk</dt> <dd>white cold drink</dd> </dl>
    • Result:
    • Coffee black hot drink
    • Milk white cold drink

HTML Div Element

  • The <div> element is used as a container for other HTML elements
  • The <div> element is by default a block element, meaning it takes all available width, and comes with line breaks before and after
  • It can contain other block display and inline display elements
  • There can be many <div> containers on the same page

Structural Elements

  • Structural elements include:
    • Header - <header></header>
    • Nav - <nav></nav>
    • Main - <main></main>
    • Footer - <footer></footer>

HTML Tables

  • HTML tables arrange data into rows and columns for logical grouping
  • Table data is best presented via tabular form

Creating tables

  • Tables are created with the <table></table> tags, acting as a container for table rows
  • Table rows are created with <tr></tr> tags, providing a container for table data cells
  • Table data cells are created with <td></td> tags, enclosing the actual data
  • Creating tables example:
<table>
  <tr>
    <td>Month</td>
    <td>Sales</td>
  </tr>
  <tr>
    <td>January</td>
    <td>$10,000</td>
  </tr>
</table>
  • Output:

Month Sales January $10,000

Enhancing tables

  • Optionally, the </td> and </tr> closing tags can be omitted
  • Table titles are specified with the <caption></caption> tags, and row/column headings with <th></th> tags
  • Caption must immediately follow the opening <table> tag
  • Table title can be specified with tags
  • Column headings can be added using tags
  • Table headers and footers can be enhanced with special rows using and
  • Standard rows are enclosed using after those elements are used
  • Keypoints for enhancement
    • Multiple elements can group rows for long tables
    • Headers and footers repeat on each page when printed
    • must appear before , but after if applicable
    • Enhancements improve readability and organization

Table Colspan & Rowspan

  • Colspan makes a cell span over multiple columns
  • Rowspan makes a cell span over multiple rows

Studying That Suits You

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

Quiz Team

Related Documents

Chapter 01 HTML PDF

More Like This

Use Quizgecko on...
Browser
Browser