HTML Basics Quiz

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 is the primary function of HTML?

  • To manage server-side logic of web applications.
  • To style the visual appearance of web pages.
  • To define the structure and content of web pages. (correct)
  • To add interactivity to web pages with scripts.

Which tag is used to indicate the start of an HTML document?

  • <html> (correct)
  • <start>
  • <doc>
  • <head>

What is the correct syntax for a comment in HTML?

  • # This is a comment
  • /*This is a comment*/
  • //This is a comment
  • <!-- This is a comment --> (correct)

What defines an HTML element?

<p>A start tag, some content, and an end tag. (C)</p> Signup and view all the answers

What is the term for elements within other elements?

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

Which of the following is an example of an empty HTML element?

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

What is the root element of an HTML document?

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

Which HTML element is used to define a paragraph?

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

In HTML, what does &nbsp; represent?

<p>A non-breaking space. (B)</p> Signup and view all the answers

What do HTML attributes provide?

<p>Additional information about HTML elements. (D)</p> Signup and view all the answers

Where are HTML attributes typically specified within an HTML element?

<p>In the start tag (A)</p> Signup and view all the answers

Which HTML attribute is used to specify the URL that a hyperlink navigates to?

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

What is the default display behavior of a block-level element in HTML?

<p>It always starts on a new line and browsers add some space before and after it. (A)</p> Signup and view all the answers

What is the primary feature that distinguishes an inline element from a block-level element?

<p>Inline elements do not start on a new line and only take up as much width as necessary. (D)</p> Signup and view all the answers

Which HTML tags are used to define the most and least important headings respectively?

<h1> and <h6> (A) Signup and view all the answers

What is the correct HTML tag used to define a paragraph?

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

What is the purpose of the <blockquote> tag in HTML?

<p>To define a section that is quoted from another source. (B)</p> Signup and view all the answers

Which HTML tag is primarily used to create hyperlinks that allow users to navigate between web pages?

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

Besides href, which attribute is frequently used within <img> tags?

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

What is the primary function of the <div> element in HTML documents?

<p>To define a division or a section. (B)</p> Signup and view all the answers

HTML describes the styling of a web page.

<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

The <body> tag is always nested inside the <head> tag.

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

An HTML element with content includes everything from the start tag to the end tag, including the tags themselves.

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

The <html> element is considered a nested element within the <body> element.

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

The element is the parent of the element, which it's inside of.

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

In the character reference &nbsp; the nbsp stands for 'new bold space'.

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

HTML attributes are written inside the content of HTML elements.

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

The document type declaration <!DOCTYPE html> is a mandatory HTML element.

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

All HTML attributes are written in the end tag.

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

The & character is written as &amp; in HTML.

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

The src attribute within the <a> tag specifies the URL of the linked page.

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

Block-level elements do not start on new lines.

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

Inline elements typically occupy the full width of their parent container.

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

The <h1> tag represents the least important heading on a webpage.

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

The <p> tag is used to define quotations in HTML.

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

The <a> tag primarily serves to display images on a webpage.

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

The width and height attributes are commonly used within the <p> tag.

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

The <div> element is an example of an inline element.

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

Browsers display <blockquote> elements without any indentation.

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

Flashcards

HTML Attributes

Additional information about an HTML element, specified within the start tag in name/value pairs.

href Attribute

Specifies the URL of the page a link points to.

HTML tag

Defines a hyperlink, allowing users to navigate between pages.

HTML element

Defines a paragraph in an HTML document.

Signup and view all the flashcards

HTML element

Defines a division or section within an HTML document.

Signup and view all the flashcards

Block-level Elements

Elements that start on a new line and take up the full width of their container.

Signup and view all the flashcards

Inline Elements

Elements that flow in line with surrounding text, taking up only the space needed.

Signup and view all the flashcards

HTML Headings

Titles or subtitles used to structure and highlight content on a webpage. Defined using to tags.

Signup and view all the flashcards

HTML Element

Defines a section of text quoted from another source.

Signup and view all the flashcards

Default Display Value of HTML Elements

Every HTML element has a default display value based on its type, affecting how it's rendered on the page.

Signup and view all the flashcards

What is HTML?

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

Signup and view all the flashcards

What is an HTML Element?

HTML elements are the building blocks of an HTML document. They define the structure and content of the page. Each element is enclosed in a start tag and an end tag, except for empty elements which have no content.

Signup and view all the flashcards

Nested HTML Elements

HTML elements can be nested within each other, meaning one element can contain another element. This creates a hierarchical structure for the HTML document.

Signup and view all the flashcards

HTML Paragraph

The element represents a paragraph of text. It's used to create a block of text that is visually separated from other blocks on the page.

Signup and view all the flashcards

HTML Quotation

The element represents a quotation, either inline or as a separate block. Use for short quotes and for longer ones.

Signup and view all the flashcards

HTML Links

Links connect different parts of a web page or different web pages. The element is used to create links. It uses the attribute to specify the URL of the linked resource.

Signup and view all the flashcards

HTML Phrase Elements

HTML phrase elements are used to apply specific styling or semantics to a part of a text within a paragraph. Common examples include (for emphasis), (for strong emphasis), (for code snippets).

Signup and view all the flashcards

HTML List

An HTML list is a collection of items presented in a structured format. creates an unordered list (bulleted list), creates an ordered list (numbered list) and defines an item within a list.

Signup and view all the flashcards

HTML Div

The element is a generic container for grouping elements. It is used to structure content and apply styles to a group of elements.

Signup and view all the flashcards

Structural Elements

Structural elements define the overall structure of an HTML document. Examples include the element (root element), the element (for the document's head), and the element (for the visible part of the document).

Signup and view all the flashcards

HTML Tables

HTML tables are used to display data in rows and columns. Important elements include , , , and .

Signup and view all the flashcards

What are HTML attributes?

Attributes provide additional information about HTML elements within a start tag.

Signup and view all the flashcards

How are HTML attributes written?

Attributes are name-value pairs, written as name="value" within a start tag.

Signup and view all the flashcards

What does the href attribute do?

The href attribute in the a tag specifies the URL where the link leads.

Signup and view all the flashcards

What are Block elements?

Block elements start on a new line and take up the full width available, adding margins before and after.

Signup and view all the flashcards

What are Inline elements?

Inline elements flow within the line of text, taking up only as much width as necessary. They don't start on a new line.

Signup and view all the flashcards

What does the p element do?

The p element defines a paragraph, creating a block of text separated from other blocks.

Signup and view all the flashcards

What is a div element?

The div element creates divisions or sections for organizing content. It can contain other elements and is useful for styling.

Signup and view all the flashcards

What are heading tags?

Heading tags h1 to h6 define titles and subtitles of different importance levels. h1 is the most important.

Signup and view all the flashcards

What does the q element do?

The q element defines a quote from another source, typically indented by browsers for visual distinction.

Signup and view all the flashcards

What is the img tag used for?

The img tag displays an image on a webpage.

Signup and view all the flashcards

What is a web browser?

A web browser, like Google Chrome, Firefox, or Safari, is a software program designed to interpret and display HTML documents. It renders the HTML code into a visual representation of the webpage.

Signup and view all the flashcards

What is an HTML document?

An HTML document is a text file written in HTML language. It tells the web browser how to arrange and display the content on a webpage. It's made up of different elements that work together to create the final webpage.

Signup and view all the flashcards

What are nested HTML elements?

Nested HTML elements means one element can be contained within another. This creates a hierarchical structure and logical order within the HTML document. For example, a element might contain multiple elements.

Signup and view all the flashcards

What is the tag?

The tag indicates the HTML version being used and is essential for browsers to interpret the document correctly. It stands for 'Document Type Declaration.'

Signup and view all the flashcards

What is the tag?

The tag is the root element of an HTML document. It encompasses the entire document, acting as the container for all other elements. It always has a start tag and an end tag .

Signup and view all the flashcards

What is the element?

The element defines a heading on a webpage. There are six levels of headings , , , , , and , with being the largest and the smallest. They are used to structure and make the content more readable.

Signup and view all the flashcards

What is the element?

The element defines a paragraph of text. It creates a block of text visually separated from other elements on the webpage. It's used for normal text content.

Signup and view all the flashcards

Study Notes

HTML Introduction

  • HTML stands for HyperText Markup Language
  • HTML is the standard markup language for creating web pages
  • HTML describes the structure of a web page
  • HTML consists of a series of elements
  • HTML elements label pieces of content, such as headings, paragraphs, links, etc.
  • Web browsers read HTML documents and display them correctly
  • Browsers do not show the HTML tags; they use the tags to determine how to display the content

HTML Elements

  • An HTML element is defined by a start tag, some content, and an end tag
  • Example: <tagname>Content goes here... </tagname>
  • The HTML element includes everything from the start tag to the end tag.
  • Example: <h1>My First Heading</h1>

Nested HTML Elements

  • HTML elements can be nested within other elements
  • All HTML documents consist of nested HTML elements
  • Example: <html><body><h1>My Heading</h1></body></html>

HTML Attributes

  • HTML attributes provide additional information about HTML elements
  • Attributes are specified within the start tag
  • Attributes are usually name-value pairs (like name="value")
  • Examples: The href attribute for hyperlinks (<a href="https://www.example.com">), the src, width, and height attributes for images (<img src="image.jpg" width="500" height="300">), and the cite attribute for quotations (<blockquote cite="someurl">)

HTML Elements: Block vs. Inline

  • Block elements take up the full width available, starting on a new line, and often have margins before and after them
  • Inline elements only take up as much width as necessary, and do not begin on new lines
  • Examples of block elements include <p>, <div>, <h1> to <h6>. Examples of inline elements include <span>

HTML Headings

  • HTML headings are titles or subtitles on a web page defined with the <h1> to <h6> tags.
  • <h1> is the most important heading and <h6> is the least important.

HTML Paragraphs

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

HTML Quotations

  • The <blockquote> element defines a section that's quoted from another source, usually indented by browsers.
  • Example: <blockquote>This is a quote from a source.</blockquote>
  • The cite attribute can give the source of the quotation, e.g., <blockquote cite="https://www.source.com">
  • The <a> tag is used for creating hyperlinks
  • The href attribute specifies the URL of the linked page
  • Example: <a href="https://www.example.com">This is a link</a>
  • Types of links: Absolute links (link to external websites), Relative links (link to other pages on your own site), mailto links (email addresses), tel links for phone numbers
  • The mailto: protocol is used for email links (<a href="mailto:[email protected]">)
  • The tel: protocol is used for phone number links (<a href="tel:+15551234567">)

HTML Line Breaks

  • The <br> tag inserts a single line break
  • It is a void element, meaning it doesn't require a closing tag

HTML Horizontal Rules

  • The <hr> tag is a horizontal rule (line). Used for visual separation.

HTML Lists

  • HTML ordered lists (<ol>) use numbers to list items
  • HTML unordered lists (<ul>) use bullets to list items
  • HTML description lists (<dl>) list terms and their definitions

HTML Div Elements

  • The <div> element is a generic container for other HTML elements to group them logically.

Structural Elements

  • <header>, <nav>, <main>, <footer> define structural sections of a page; <header> contains headings, <nav> contains navigation, <main> contains the main page content, <footer> contains the footer content.

HTML Tables

  • Tables (<table>) are used to structure data in rows and columns
    • <tr> creates table rows.
    • <td> creates table data cells
    • <th> creates table headers.
    • <caption> specifies a table caption.
  • colspan spans data over multiple columns
  • rowspan spans data over multiple rows
  • Enclosures (e.g., <thead>, <tbody>, <tfoot>) contain table sections and enhance organization

Valid HTML

  • Writing valid HTML is critical for reliable display across different browsers
  • Using validation tools helps catch syntax errors and ensure compatibility

Table Enhancements

  • <thead> element for table head/header(s)
  • <tbody> element encloses all table body rows
  • <tfoot> element to enclose table footer(s)

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

HTML Basics Quiz
8 questions

HTML Basics Quiz

TimelyXenon avatar
TimelyXenon
HTML Fundamentals for Web Development
16 questions
Introduction to HTML Basics
8 questions

Introduction to HTML Basics

ThinnerMulberryTree avatar
ThinnerMulberryTree
Introduction to HTML Basics
5 questions
Use Quizgecko on...
Browser
Browser