Podcast
Questions and Answers
What does HTML stand for?
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?
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?
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?
Which attribute is used to specify the URL of a link?
What is the purpose of the alt
attribute in an <img>
tag?
What is the purpose of the alt
attribute in an <img>
tag?
Which tag is used to define an unordered list in HTML?
Which tag is used to define an unordered list in HTML?
Which tag is used to define a table row in HTML?
Which tag is used to define a table row in HTML?
Which HTML tag is used to define an input field for a password?
Which HTML tag is used to define an input field for a password?
How do you add a comment in HTML?
How do you add a comment in HTML?
Which attribute is used to define inline styles in HTML?
Which attribute is used to define inline styles in HTML?
In which HTML section is the meta-information about the HTML page included?
In which HTML section is the meta-information about the HTML page included?
Which tag is used to define a paragraph in HTML?
Which tag is used to define a paragraph in HTML?
Which attribute is used to specify a unique identifier for an HTML element?
Which attribute is used to specify a unique identifier for an HTML element?
Which tag is used to define a table data cell?
Which tag is used to define a table data cell?
Which of the following is the correct structure for an HTML document?
Which of the following is the correct structure for an HTML document?
Flashcards
What is HTML?
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?
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?
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?
What does the href
attribute do?
Signup and view all the flashcards
What does the src
attribute do?
What does the src
attribute do?
Signup and view all the flashcards
What is Inline CSS?
What is Inline CSS?
Signup and view all the flashcards
What is Internal CSS?
What is Internal CSS?
Signup and view all the flashcards
What is External CSS?
What is External CSS?
Signup and view all the flashcards
What is the HTML class
attribute?
What is the HTML class
attribute?
Signup and view all the flashcards
What is the HTML id
attribute?
What is the HTML id
attribute?
Signup and view all the flashcards
What does the `` tag define?
What does the `` tag define?
Signup and view all the flashcards
What does the `` tag define?
What does the `` tag define?
Signup and view all the flashcards
What does the `` tag define?
What does the `` tag define?
Signup and view all the flashcards
What does the `` tag define?
What does the `` tag define?
Signup and view all the flashcards
HTML Comments
HTML Comments
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
andheight
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
- 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
, androwspan
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.
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.