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?

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

Which of the following tags is used to define a paragraph in HTML?

  • `<br>`
  • `<p>` (correct)
  • `<h1>`
  • `<div>`

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

  • To add an image to the hyperlink
  • To specify the heading of the linked page
  • To define the URL of the page the link goes to (correct)
  • To format the appearance of the hyperlink

Which tag is used to define the most important heading in HTML?

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

Which of the following is the correct HTML tag for inserting a line break?

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

Which tag is used to create an unordered list in HTML?

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

What does a browser use HTML tags for?

<p>To determine how to display the document (C)</p>
Signup and view all the answers

Which tag defines a division or a section in an HTML document and is a block-level element?

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

In HTML, what is considered an empty element?

<p>An element with no content and no end tag (B)</p>
Signup and view all the answers

Which tag is used to create a hyperlink to an email address?

<p><code>&lt;a&gt;</code> with <code>href=&quot;mailto:&quot;</code> (A)</p>
Signup and view all the answers

HTML stands for Hyper Text Manipulation Language.

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

Browsers display HTML tags on the web page.

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

HTML documents must start with a declaration.

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

HTML elements have both a start and an end tag.

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

HTML elements can be nested inside other HTML elements.

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

HTML attributes provide additional information about HTML elements and are specified in the end tag.

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

Block-level elements always start on a new line.

<p>True (A)</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 <p> tag.

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

HTML lists can only be unordered (bulleted).

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

Which HTML tag is used to embed images?

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

Which attribute specifies the location of an image in the <img> tag?

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

What happens when images are scaled up beyond their original dimensions?

<p>They may become pixelated. (A)</p>
Signup and view all the answers

Which tag is used to embed audio files in HTML?

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

Which attribute specifies the audio file to be played in the <audio> tag?

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

Which attribute, when present, tells the browser to display audio controls?

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

Which of these is a boolean attribute for the <audio> tag?

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

Which of these attributes defines the height of the video display area?

<p>height (C)</p>
Signup and view all the answers

Which element is used within the <video> tag to specify different video file formats for browser compatibility?

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

The src attribute in the img tag specifies the image file name.

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

The width attribute in the img tag specifies the file size of the image.

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

Scaling up an image always maintains the image clarity.

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

External audio files can be embedded in an HTML document using the <audio> tag.

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

The controls attribute in the <audio> tag automatically starts playing the audio.

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

The 'autoplay' attribute requires a value assignment (e.g., autoplay="true") to work correctly within an audio tag.

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

Browsers support all audio codecs equally.

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

The <video> tag cannot embed external videos.

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

WEBM video is a patented video compression standard.

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

The <track> tag is used to specify subtitles for a video.

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

Flashcards

What is HTML?

HTML stands for Hyper Text Markup Language, which is the standard markup language for creating web pages. It describes the structure of a web page using elements.

HTML Element

An HTML element is defined by a start tag, some content, and an end tag. It includes everything from the start tag to the end tag.

Nested HTML Elements

HTML elements can be nested inside other HTML elements. All HTML documents consist of nested HTML elements.

HTML Attributes

HTML attributes provide additional information about HTML elements. They are always specified in the start tag and usually come in name/value pairs.

Signup and view all the flashcards

Block vs. Inline Elements

Block-level elements start on a new line and take up the full width available. Inline elements do not start on a new line and only take up as much width as necessary.

Signup and view all the flashcards

HTML Headings

HTML headings are titles or subtitles displayed on a webpage. They are defined with the <h1> to <h6> tags, with <h1> being the most important and <h6> the least.

Signup and view all the flashcards

HTML Paragraphs

HTML paragraphs are defined with the <p> tag. They are used to structure and display blocks of text on a webpage.

Signup and view all the flashcards

HTML Links

The <a> tag in HTML creates hyperlinks, allowing users to navigate between pages. The href attribute specifies the URL of the linked page.

Signup and view all the flashcards

HTML Lists

HTML lists are used to group related items in lists. Unordered lists <ul> are marked with bullets, ordered lists <ol> are marked with numbers, and description lists <dl> contain terms and descriptions.

Signup and view all the flashcards

HTML Div Element

The <div> element is a container for other HTML elements. It is by default a block element and can be used to create sections on a page.

Signup and view all the flashcards

Web Browsers

Software applications that allow users to view web pages. They read HTML documents and display them accordingly, using the HTML tags to determine how to render the content.

Signup and view all the flashcards

DOCTYPE declaration

A declaration that specifies the HTML version used in the document. It must be the first thing in the HTML document: <!DOCTYPE html>

Signup and view all the flashcards

HTML blockquote

A tag that defines a section quoted from another source. Browsers typically indent <blockquote> elements.

Signup and view all the flashcards

HTML Line Break Element

Creates a line break in the text. It is a stand-alone tag, called a void element in HTML5.

Signup and view all the flashcards

HTML Horizontal Rule Element

Configures a horizontal line on the page. In HTML5, it should be used to indicate a thematic break.

Signup and view all the flashcards

HTML Phrase Elements

Elements indicating the context and meaning of text, displayed inline.

Signup and view all the flashcards

mailto: links

An HTML tag used to create clickable links for email addresses. It uses the mailto: protocol in the href attribute.

Signup and view all the flashcards

tel: links

An HTML tag that creates clickable phone number links, useful on mobile devices, opens phone app.

Signup and view all the flashcards

Structural Elements

Tags used to define structural sections: header, nav, main, and footer.

Signup and view all the flashcards

tag

Used to embed images in HTML documents. It uses the 'src' attribute to specify the image URL.

Signup and view all the flashcards

src attribute

Specifies the image location URL, can be absolute or relative, required inside the tag.

Signup and view all the flashcards

alt attribute

Specifies text describing the image, for use when the image cannot be loaded, useful for accessibility.

Signup and view all the flashcards

width attribute

Specifies the pixel width of the area the image will occupy.

Signup and view all the flashcards

height attribute

Specifies the pixel height of the area the image will occupy.

Signup and view all the flashcards

Scaling Up

Enlarging images beyond their original dimensions, causing visible pixels and reduced quality.

Signup and view all the flashcards

Scaling Down

Reducing image size is more efficient and maintains clarity if managed carefully.

Signup and view all the flashcards

HTML element used to embed audio content in a document.

Signup and view all the flashcards

src attribute (audio)

Specifies the audio resource URL. It's an attribute of audio.

Signup and view all the flashcards

autoplay attribute

A boolean attribute that specifies the browser should immediately start playing the audio resource.

Signup and view all the flashcards

loop attribute

A boolean attribute that specifies the browser should play the audio resource repeatedly.

Signup and view all the flashcards

controls attribute (audio)

A boolean attribute that specifies the browser should display user controls to start or stop the audio playing.

Signup and view all the flashcards

preload attribute

Specifies how the audio resource should be loaded.

Signup and view all the flashcards

HTML element used to embed video content in a document.

Signup and view all the flashcards

element (video)

Used in the video tag to specify multiple video file formats for browser compatibility.

Signup and view all the flashcards

Advanced Video Coding (AVC)

A patented standard that is also known as H.264 or MPEG-4 (.mp4 files).

Signup and view all the flashcards

WEBM video

A royalty-free alternative to the patented H.264 and MPEG-4 standard (.webm files).

Signup and view all the flashcards

tag

Tag used in

Signup and view all the flashcards

src attribute (track)

Specifies the WebVTT file for the tag.

Signup and view all the flashcards

kind attribute

Specifies the track type.

Signup and view all the flashcards

srclang attribute

Specifies the language of the track text data.

Signup and view all the flashcards

default attribute

When present, the subtitles will enable by default.

Signup and view all the flashcards

Maintain aspect ratio

Ensuring the width and height of an image are scaled proportionally to maintain its original shape.

Signup and view all the flashcards

Embedding audio

External audio files (e.g., MP3) are embedded using the

Signup and view all the flashcards

element (audio)

Used within the tag to provide alternative audio formats for different browsers.

Signup and view all the flashcards

Embedding video

External video files (MP4) can be embedded into HTML using the tag.

Signup and view all the flashcards

Study Notes

Incorporate Media Content

  • Images, audio, and video can be added to HTML documents.

Add Images

  • Images improve the design and appearance of a webpage.
  • Use the <img> tag to add images to an HTML document.
  • The src attribute specifies the image location URL and is required.
  • It can be an absolute or relative path.
  • The width attribute is recommended to specify the pixel width of the image.
  • The height attribute is recommended to specify the pixel height of the image.
  • The alt attribute is recommended to describe the image, for cases where it can't load.
  • Scaling images too large beyond their original dimensions causes pixelation.
  • Scaling down reduces image size and maintains clarity but must be managed carefully.
  • Ensure the width and height are scaled proportionally to maintain the image's aspect ratio.

Add Audio

  • External audio, like MP3 music files, can be embedded using the <audio></audio> tags.
  • The src attribute specifies the audio resource URL.
  • autoplay is a boolean attribute that starts playing the audio immediately.
  • loop is a boolean attribute that makes the audio play repeatedly.
  • controls is a boolean attribute that displays user controls for the audio.
  • preload accepts "auto" or "none" to suggest if the browser should preload the audio.
  • Boolean attributes like autoplay, loop, and controls work by their presence alone.
  • Browsers use built-in codecs to decode audio, but not all support the same codecs.
  • AAC (mp4a.40.2) is used for MP3 audio and supported by Chrome, Firefox, and Edge.
  • Ogg (vorbis) is used for OGG format audio and supported by other browsers.
  • To handle different codecs, use two <source> elements within the <audio> tag.
  • Each specifies the URL in src and the MIME type in the type attribute.

Add Video

  • External video, like MP4 video files, can be embedded using <video> tags.
  • The element can include src, autoplay, loop, controls, and preload attributes.
  • Dimensions of the video display area can be specified with width and height attributes.
  • Advanced Video Coding (AVC) is a patented standard, also known as H.264 or MPEG-4 (.mp4 files).
  • WEBM video is a royalty-free alternative to H.264 and MPEG-4 (.webm files).
  • Use <source> elements in a <video> tag to specify video files in multiple formats.
  • A <track> tag in a <video> tag adds subtitles.
  • src specifies the WebVTT file.
  • kind specifies the track type.
  • srclang specifies the language.
  • default enables subtitles by default.

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

HyperText Markup Language (HTML)
30 questions
Intro to HTML: HyperText Markup Language
47 questions
Introduction to HTML
10 questions

Introduction to HTML

CapableTsavorite avatar
CapableTsavorite
Introduction to HTML
10 questions

Introduction to HTML

FlawlessGulf8296 avatar
FlawlessGulf8296
Use Quizgecko on...
Browser
Browser