Introduction to HTML Flashcards
Markup is used to…
…annotate text, images, and other content for display in a browser.
General Structure of HTML Code
This is content.
Attributes of <a>:
target</a>
Example
1. </a><a>text</a>
target specifies the browsing context used to display the link.
Example Output
target=”_blank” opens the link in a new tab
Attributes of <a>:
title</a>
Example
1. </a><a>Homepage</a>
title specifies extra information about the link, which will appear as a tooltip when hovered over.
Example Output
The link will have a tooltip that says “The Homepage” when hovered over.
Attributes of <a>:
href</a>
Example
1. </a><a>link text</a>
href specifies the web address the hyperlink will point to.
Example Output
“link text”, when clicked, will open website.com.
Attribute:
class
The class attribute gives the element an identifying name that can be used to target the element later.
What is the purpose of an attribute?
Attributes contain information about the element that doesn’t appear in the actual content.
What part of the following is an attribute?
- <p>My cat is grumpy.</p>
class=”editor-note” is the attribute.
Empty (Void) Elements
Example
1. <img></img>
Empty elements consist only of a single tag.
They are usually used to insert or embed something.
Example Output
The code embeds image.jpg into the web page.
Inline Elements
Example
1. <em>This</em><strong> is</strong><em> Inline.</em>
Inline elements are contained within block-level elements and do not cause a new line to appear.
Example Output
This(Italic) is(bold) Inline(Italic).
Block-Level Elements
Example
1. <p>This</p><p> is</p><p> Block-Level.</p>
Block-level elements form a visible block on the page.
They begin on a new line and are followed by a new line.
They tend to be structural elements, such as menus, paragraphs, lists, footers, etc.
Example Output
This
is
Block-Level.
Nested Elements
Example
1. <p>My cat is <strong>very</strong> angry.</p>
Elements can be nested inside of each other.
Example Output
My cat is very(bold) angry.
What is MDN?
The Mozilla Developer Network is a good resource for web developers.
Read the relevant MDN page before each video.
How do I find what I need on MDN?
Search “keyword + MDN” on Google to find what you need.
<a></a>
Creates a hyperlink.
“a” stands for anchor.
<em></em>
Gives text an italic emphasis.
Are tag names case-sensitive?
No, though standard convention is to start all tags with a lower-case letter.
<p></p>
Creates a paragraph.
<strong></strong>
Makes text bold.
<b> is being deprecated.</b>
What does it mean to sat something is being deprecated?
It is being phased out.