Introduction to HTML
15 Questions
0 Views

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

  • Home Tool Management Language
  • HyperText Transfer Language
  • HyperText Markup Language (correct)
  • High-Level Text Management Language

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

  • `<h6>`
  • `<heading>`
  • `<head>`
  • `<h1>` (correct)

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

  • `<newline>`
  • `<lb>`
  • `<break>`
  • `<br>` (correct)

Which attribute is used to specify the URL of a link?

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

What is the purpose of the alt attribute in an <img> tag?

<p>To provide alternative text if the image cannot be displayed (D)</p> Signup and view all the answers

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

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

Which tag is used to define a table row in HTML?

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

Which HTML tag is used to define an input field for a password?

<p><code>&lt;input type=&quot;password&quot;&gt;</code> (C)</p> Signup and view all the answers

How do you add a comment in HTML?

<p><code>&lt;!-- This is a comment --&gt;</code> (B)</p> Signup and view all the answers

Which attribute is used to define inline styles in HTML?

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

In which HTML section is the meta-information about the HTML page included?

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

Which tag is used to define a paragraph in HTML?

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

Which attribute is used to specify a unique identifier for an HTML element?

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

Which tag is used to define a table data cell?

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

Which of the following is the correct structure for an HTML document?

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

Flashcards

What is HTML?

HyperText Markup Language, the standard language for creating web pages, describing their structure using elements and tags.

What is an HTML Element?

A block of content in an HTML document, defined by a start tag, content, and an end tag. Browsers use these to interpret page content.

What are HTML Attributes?

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

What does the href attribute do?

Specify the URL of the page the link goes to.

Signup and view all the flashcards

What does the src attribute do?

Specify the path to the image to be displayed.

Signup and view all the flashcards

What is Inline CSS?

Used to style HTML elements directly within the element using the style attribute.

Signup and view all the flashcards

What is Internal CSS?

Defined within the element, inside the section of an HTML document.

Signup and view all the flashcards

What is External CSS?

Defined in external .css files, linked to the HTML document using the element in the section.

Signup and view all the flashcards

What is the HTML class attribute?

Specifies one or more class names for an element and is used to point to a class in a style sheet, allowing multiple elements to share the same style.

Signup and view all the flashcards

What is the HTML id attribute?

Specifies a unique id for an HTML element. The value must be unique within the document and is used by CSS and JavaScript to target specific elements.

Signup and view all the flashcards

What does the `` tag define?

Defines the most important heading in HTML

Signup and view all the flashcards

What does the `` tag define?

Defines paragraphs to display blocks of text

Signup and view all the flashcards

What does the `` tag define?

defines an unordered list in HTML

Signup and view all the flashcards

What does the `` tag define?

defines an ordered list in HTML

Signup and view all the flashcards

HTML Comments

used to add notes within HTML code that aren't displayed in the browser

Signup and view all the flashcards

Study Notes

  • HTML stands for HyperText Markup Language
  • It is the standard markup language for creating web pages
  • HTML describes the structure of a web page
  • HTML elements tell the browser how to display content
  • HTML elements are the building blocks of HTML pages
  • HTML elements are represented by tags
  • HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
  • Browsers do not display the HTML tags, but use them to interpret the content of the page

HTML Structure

  • An HTML document starts with a document type declaration <!DOCTYPE html>
  • The HTML document itself begins with <html> and ends with </html>
  • Inside the <html> element there are two main parts: the <head> section and the <body> section
  • The <head> element contains meta-information about the HTML page, such as the title, character set, styles, and links to scripts
  • The <body> element contains the visible page content, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.

HTML Elements

  • HTML elements are defined by a start tag, some content, and an end tag
  • The HTML element is everything from the start tag to the end tag
  • Example: <p>This is a paragraph.</p>
  • Some HTML elements have no content (empty elements)
  • Empty elements are closed in the start tag
  • Example: <br> is an empty element (line break)
  • Start tags generally consist of the element name inside angle brackets e.g. <p>
  • End tags generally consist of the element name preceded by a forward slash inside angle brackets e.g. </p>

HTML Attributes

  • HTML attributes provide additional information about HTML elements
  • Attributes are always specified in the start tag
  • Attributes usually come in name-value pairs like: name="value"
  • The href attribute in the <a> tag specifies the URL of the page the link goes to
  • Example: <a href="https://www.example.com">This is a link</a>
  • The src attribute in the <img> tag specifies the path to the image to be displayed
  • Example: <img src="image.jpg" alt="My Image">
  • The width and height attributes in the <img> tag specify the width and height of the image
  • The alt attribute specifies an alternate text for an image, if the image cannot be displayed
  • The style attribute is used to add styles to an element, such as color, font, size, and more

HTML Headings

  • HTML headings are defined with the <h1> to <h6> tags
  • <h1> defines the most important heading
  • <h6> defines the least important heading
  • Only Use one <h1> per page - this should represent the main subject of the page

HTML Paragraphs

  • HTML paragraphs are defined with the <p> tag
  • Paragraphs are used to display blocks of text
  • Browsers automatically add a single blank line before and after a paragraph
  • HTML links are defined with the <a> tag
  • The href attribute specifies the destination address of the link
  • By default, links will appear as follows in all browsers: An unvisited link is underlined and blue, a visited link is underlined and purple, an active link is underlined and red

HTML Images

  • HTML images are defined with the <img> tag
  • The src attribute specifies the URL of the image
  • The alt attribute specifies an alternate text for the image, if the image cannot be displayed
  • Always specify the width and height of an image. If width and height are not specified, the page might flicker while the image loads

HTML Lists

  • HTML supports ordered, unordered, and description lists
  • HTML unordered lists are defined with the <ul> tag
  • Each item in the list is defined with the <li> tag
  • By default, unordered lists will display a bullet point in front of each list item
  • HTML ordered lists are defined with the <ol> tag
  • Each item in the list is defined with the <li> tag
  • By default, ordered lists will display a number in front of each list item
  • HTML description lists are defined with the <dl> tag
  • Each term is defined with the <dt> tag
  • Each description is defined with the <dd> tag

HTML Tables

  • HTML tables are defined with the <table> tag
  • Each table row is defined with the <tr> tag
  • A table header is defined with the <th> tag
  • A table data/cell is defined with the <td> tag
  • Tables can include attributes such as border, width, height, colspan, and rowspan to control their appearance and layout

HTML Forms

  • HTML forms are used to collect user input
  • HTML forms are defined with the <form> tag
  • Input elements are the most important form elements
  • Input elements can be of several types, including text fields, checkboxes, radio buttons, submit buttons, and more
  • The <input type="text"> defines a single-line text input field where a user can enter text
  • The <input type="password"> defines a password field
  • The <input type="submit"> defines a submit button
  • The <textarea> element defines a multi-line text input control (text area)
  • The <select> element defines a drop-down list
  • The <option> elements define the available options in the list
  • The label element defines a label for several form elements

HTML Comments

  • HTML comments are not displayed in the browser, but they can help document your HTML source code
  • Comments are written inside <!--...-->
  • You can add comments to your HTML source by using the following syntax: <!-- This is a comment -->

HTML Styles (CSS)

  • CSS (Cascading Style Sheets) is used to style HTML elements
  • CSS can be added to HTML elements in 3 ways: Inline, Internal, External
  • Inline CSS is added to individual HTML elements using the style attribute
  • Internal CSS is defined within the <style> element, inside the <head> section
  • External CSS is defined in external CSS files
  • To use external CSS, add a link to it in the <head> section of the HTML page

HTML Classes

  • The HTML class attribute specifies one or more classnames for an element
  • Classes are used to point to a class name in a style sheet
  • Multiple HTML elements can share the same class
  • Class names should start with a letter (A-Z or a-z)
  • Class names can contain letters, digits, hyphens, and underscores
  • Separate multiple class names with a space (e.g. class="city main")

HTML IDs

  • The HTML id attribute specifies a unique id for an HTML element
  • The value of the id attribute must be unique within the HTML document
  • The id attribute is used to point to a specific style declaration in a style sheet
  • It is also used by JavaScript to access and manipulate the element with the specific id
  • Id names should start with a letter (A-Z or a-z)
  • Id names can contain letters, digits, hyphens, and underscores

Studying That Suits You

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

Quiz Team

Description

Learn the basics of HTML, the standard markup language for creating web pages. Understand HTML structure including the document type declaration, head, and body. Explore HTML elements and how browsers interpret tags to display content.

More Like This

Use Quizgecko on...
Browser
Browser