Podcast
Questions and Answers
What does HTML stand for?
What does HTML stand for?
Hyper Text Markup Language
HTML is the standard markup language for creating Web pages.
HTML is the standard markup language for creating Web pages.
True (A)
What does HTML describe?
What does HTML describe?
the structure of a Web page
What is an HTML element defined by?
What is an HTML element defined by?
What is the purpose of a web browser?
What is the purpose of a web browser?
Which tag defines the most important heading?
Which tag defines the most important heading?
<h6>
defines the least important heading.
<h6>
defines the least important heading.
What tag defines HTML paragraphs?
What tag defines HTML paragraphs?
What tag defines HTML links?
What tag defines HTML links?
What is the name of the tag which is used for images?
What is the name of the tag which is used for images?
HTML elements can have attributes.
HTML elements can have attributes.
The ______ attribute specifies the URL of the page the link goes to.
The ______ attribute specifies the URL of the page the link goes to.
The <img>
tag is used to embed an image in an HTML page. What does the src attribute specify?
The <img>
tag is used to embed an image in an HTML page. What does the src attribute specify?
What do the width and height attributes specify?
What do the width and height attributes specify?
What does the alt attribute specify?
What does the alt attribute specify?
The ______ attribute is used to add styles to an element, such as color, font, size, and more.
The ______ attribute is used to add styles to an element, such as color, font, size, and more.
The ______ attribute defines some extra information about an element.
The ______ attribute defines some extra information about an element.
What tag defines a thematic break in an HTML page?
What tag defines a thematic break in an HTML page?
Which HTML element defines a line break?
Which HTML element defines a line break?
Which HTML element defines preformatted text?
Which HTML element defines preformatted text?
Which CSS property defines the background color for an HTML element?
Which CSS property defines the background color for an HTML element?
Which CSS property defines the text color for an HTML element?
Which CSS property defines the text color for an HTML element?
Which CSS property defines the font to be used for an HTML element?
Which CSS property defines the font to be used for an HTML element?
Which CSS property defines the horizontal text alignment for an HTML element?
Which CSS property defines the horizontal text alignment for an HTML element?
Flashcards
What does HTML stand for?
What does HTML stand for?
Hyper Text Markup Language, the standard markup language for creating web pages.
What is the primary role of HTML?
What is the primary role of HTML?
HTML describes the structure of a web page using elements.
What does HTML consist of?
What does HTML consist of?
A series of elements that tell the browser how to display content.
What is an HTML element?
What is an HTML element?
Signup and view all the flashcards
What are the key parts of an HTML element?
What are the key parts of an HTML element?
Signup and view all the flashcards
What does a complete HTML element include?
What does a complete HTML element include?
Signup and view all the flashcards
What is an absolute URL?
What is an absolute URL?
Signup and view all the flashcards
What is a relative URL?
What is a relative URL?
Signup and view all the flashcards
Study Notes
- HTML stands for Hyper Text Markup Language
- It is the standard markup language for creating Web pages
- HTML describes the structure of a Web page
- It consists of a series of elements
- HTML elements tell the browser how to display the content
- HTML elements can label pieces of content such as headings, paragraphs, and links
HTML Document Structure
- The basic structure includes the html, head, title and body.
html <html> <head> <title>Page Title</title> </head> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html>
HTML Elements
- Elements are defined by a start tag, content, and end tag:
<tagname>Content goes here...</tagname>
- An HTML element is everything from the start tag to the end tag
- Examples include:
My First Heading
andMy first paragraph.
Web Browsers
- Web browsers like Chrome, Edge, Firefox, and Safari read HTML documents and display them correctly
- Browsers use HTML tags to determine how to display the document but do not display the HTML tags themselves
HTML Editors
- Text editors are all that is needed to work with HTML
- Notepad on PC and TextEdit on Mac are recommended for learning HTML
Steps to Create an HTML Page
- Open a text editor and write or copy HTML code
- Save the file with a ".htm" extension with UTF-8 encoding
- Open the saved HTML file in a web browser to view the result
HTML Headings
- Headings are defined with
to
tags
- The
tag defines the most important heading, while
defines the least
<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
tag:
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Links
- Links are defined with the tag
<a href="https://stdominiccollege.edu.ph/">This is a link</a>
HTML Images
- Images are defined with the
tag
- Attributes such as the source file (src), alternative text (alt), width, and height are included
<img src="picture.jpg" alt="SDCA Logo" width="104" height="142">
Nested HTML Elements
- HTML elements can be nested inside each other
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Skipping End Tags
- Some HTML elements display correctly even if the end tag is omitted; however, it is best practice not to skip closing tags
Empty HTML Elements
- HTML elements with no content are known as empty elements
- Example: The
tag defines a line break and does not require a closing tag
<p>This is a <br> paragraph with a line break.</p>
HTML Attributes
- All HTML elements can have attributes, which provide additional information
- Attributes are specified in the start tag and usually come in name/value pairs
- Example:
name="value"
The href
Attribute
- Used with the tag to define hyperlinks
- Specifies the URL of the page the link goes to
<a href="https://stdominiccollege.edu.ph/">Visit SDCA Website</a>
The src
Attribute
- Used with the
tag to embed images
- Specifies the path to the image
Types of URLs
- Absolute URLs: Link to an external image on another website with the full URL:
src="https://stdominiccollege.edu.ph/images/one-asia-heritage/asean/brunei-1.jpg"
- Relative URLs: Link to an image within the website, without including the domain name:
src="img_girl.jpg"
The width
and height
Attributes
- Used with the
tag to specify the dimensions of the image in pixels
<img src="img_girl.jpg" width="500" height="600">
The alt
Attribute
- Used with the
tag, it specifies alternate text for an image if it cannot be displayed, due to slow connection, an error, or the use of a screen reader
<img src="img_girl.jpg" alt="Girl with a jacket">
- What happens if we try to display and image that does not exist?
<img src="img_typo.jpg" alt="Girl with a jacket">
The style
Attribute
- Used to add styles to an element, affecting the visual appearance
<p style="color:red;">This is a red paragraph.</p>
The title
Attribute
- Specifies extra information about an element
- The value of the title attribute displays as a tooltip on mouse hover
<p title="I'm a tooltip">This is a paragraph.</p>
Quoting Attribute Values
- Although the HTML standard doesn't require quotes around attribute values, it is best practice to always use quotes
<a href="https://www.google.com/html/">Visit Google Website</a>
- Sometimes you have to use quotes
<p title=About SDCA>
HTML Headings
- Headings are titles or subtitles displayed on a webpage
<h1>
to<h6>
tags are used to define headings of decreasing importance, influencing prominence and hierarchy
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
Bigger HTML Headings
- HTML headings have a default size, the
style
attribute and CSSfont-size
property can be used to customize the font sie
<h1 style="font-size:60px;">Heading 1</h1>
HTML Paragraphs
- A paragraph always starts on a new line
- Browsers automatically add some white space (a margin) before and after a paragraph
- the HTML
element defines it
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Display
- HTML ignores extra lines and spaces in the source code
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<p>
This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>
HTML Horizontal Rules
- The
<hr>
tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule. - Used to visually separate or define a change in content
HTML Line Breaks
- The
<br>
element defines a line break without starting a new paragraph. - If you want a line break (a new line) without starting a new paragraph
The Poem Problem
- By default, HTML collapses multiple lines into a single line when using the
tag
<br>
is used to fix it
<p>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</p>
The HTML <pre>
Element Usage
- The HTML
<pre>
element defines preformatted text, preserving both spaces and line breaks
<pre>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</pre>
HTML Styles
- Used to add styles such as color, font, size, and more
The HTML Style Attribute
- Setting the style of an HTML element, can be done with the style attribute.
<tagname style="property:value;">
- Property is a CSS property.
- Value is a CSS value.
Specific Styling
- The CSS
background-color
property defines the background color
<body style="background-color: powderblue;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
Text Color
- The CSS
color
property defines the text color
<h1 style="color:blue;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
Fonts
- The CSS
font-family
property defines the font to be used for an HTML element
<h1 style="font-family: verdana;">This is a heading</h1>
<p style="font-family: courier; ">This is a paragraph.</p>
Text Size
- The CSS
font-size
property defines the text size for an HTML element
<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>
Text Alignment
- The CSS
text-align
property defines the horizontal text alignment for an HTML element
<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center; ">Centered paragraph.</p>
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.