HTML Basics Flashcards
Learn about the basic tags and structure of HTML documents. (20 cards)
The first tag inside of an HTML page is usually what?
<!DOCTYPE>
<!DOCTYPE> must be capitalized, true or false?
False, but it is so by typical convention.
<head> is the same as <header>, true or false?
</header></head>
False. <head> is used for metadata in-line elements, such as <title>. <header> includes content and is typically used for navigate, page headers, etc.</title>
<head> goes inside of a <body> block, true of false?
</body></head>
False, <header> goes inside of a <body>.
You can have multiple <body> elements on a page, true or false?
False, the HTML specification requires exactly one <body> element per document. If you add more than one, it’s implementation-specific (left up to the browser) as to what happens. It could ignore the second <body> tag, fail to render, or something else!
<head> must come before <body>, true or false?
</body></head>
True, the HTML specification requires this to process metadata, like CSS links, character encodings, and page titles, before the content is rendered. Browsers may correct this behavior for you.
<main> must go within a <body> element, true or false?
</body></main>
True, the <main> element must go within a <body> element, since <main> represents the main content of the document that is visible to users.
<main> must be composed by<section> elements, true or false?
</section></main>
False, while the <main> element may be composed of <section> elements, it does not have to be.
For example, sample content with <section> elements:
<main> <section> <h2>About Us</h2> <p>Company information...</p> </section> <section> <h2>Our Services</h2> <p>Service details...</p> </section> </main>
Sample content without <section> elements include:
<main> <article> <h1>Blog Post Title</h1> <p>Blog content...</p> </article> </main>
Or there could be mixed content:
<main> <h1>Welcome</h1> <p>Introduction paragraph...</p> <section> <h2>Features</h2> <ul>...</ul> </section> <div class="call-to-action"> <button>Get Started</button> </div> </main>
Paths that we create are case sensitive, true or false?
True. For example, the page named by the path hello-world.html
is not the same as Hello-World.html
.
What tag is name represents a hyperlink?
<a></a>
What does the “a” in the <a> tag stand for?</a>
anchor
HTML ________ are special words used within an HTML tag to modify the element’s behavior or appearance.
attributes
href attribute values require double quotations. For example, href=”index/html”. True or false?
False, they can be single or double quotations as long as the starting and ending quotations match.
href=”#” is a valid hypertext reference, true or false?
True
What’s the difference between a relative and absolute hypertext reference?
A relative hypertext reference represents a location internal to your website. An absolute reference represents an external location, such as https://en.wikipedia.org/
The ___ attribute on the <img></img> element holds a textual replacement for the image, which is mandatory and incredibly useful for accessibility
alt
<img></img> is a self closing element, true or false?
True, you don’t need a closing </img> tag. However, you can use a trailing / at the end of your tag. For example, “<img></img>
The alt attribute inside of an <img>
element can be an empty string. For example, <img alt="">
true or false?
True, the alt
attribute may be empty, but it must exist to be a valid image. You may leave the alt value empty to show that the image doesn’t offer any additional context and is, for example, just decorative. This may include logos, etc.
The <link>
element is used to link a CSS page, true or false?
True
CSS sheets are added to HTML pages within the <head> block element, true or false?
True