Intro To HTML Flashcards

1
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is HTML?

A

HTML stands for HyperText Markup Language. It’s the standard language used to create and structure content on the World Wide Web. It uses tags to define elements like headings, paragraphs, images, and links.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an HTML Tag?

A

Keywords surrounded by angle brackets (< >), like <p>. Most tags come in pairs: an opening tag (<tag>) and a closing tag (</tag>). The content goes between the tags. Some tags, called empty tags, don’t need a closing tag (e.g., <img></img>, <br></br>).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Basic HTML Document Structure

A

A typical HTML5 document structure includes: 1. <!DOCTYPE html> (Declaration), 2. <html> (Root element), 3. <head> (Meta-information container), 4. <body> (Visible content container).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

<!DOCTYPE html>

A

This declaration MUST be the very first thing in your HTML document. It tells the web browser that the page is written in HTML5. It is not an HTML tag itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

<head> Tag
</head>

A

The container for metadata (data about the HTML document). It includes elements like <title>, <meta></meta>, <link></link> (for CSS), and

. Content inside <head> is not rendered directly on the webpage, except for the <title>.</title>
</title>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

<title> Tag
</title>

A

Defines the title of the HTML document. This title is shown in the browser’s title bar or on the page’s tab. It’s placed inside the <head> section.

Example: <title>My Awesome Web Page</title>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

<body> Tag
</body>

A

Contains all the visible content of an HTML page, such as headings, paragraphs, images, hyperlinks, tables, lists, etc. There should only be one <body> element in a document.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Heading Tags (<h1> to <h6>)

A

Define HTML headings. <h1> defines the most important heading, <h6> defines the least important. Used for document structure and SEO.

Example: <h1>Main Page Title</h1><h2>Subheading</h2>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

<p> Tag
</p>

A

Defines a paragraph of text. Browsers automatically add some vertical space (margin) before and after each <p> element.

Example: <p>This is a block of text forming a paragraph.</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

<a> Tag (Anchor Tag)</a>

A

Defines a hyperlink, used to link from one page/resource to another. The destination is specified using the href attribute.

Example: <a>Visit Google</a>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an HTML Attribute?

A

Provides additional information about an HTML element. Attributes are always specified in the opening tag and usually come in name/value pairs like name=”value”. Examples: href, src, alt, id, class, style.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

href Attribute

A

Used with the <a> (anchor) tag to specify the URL (Uniform Resource Locator) or path of the page the link goes to.</a>

Example: href=”contact.html” or href=”https://example.com”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

<img></img> Tag

A

Used to embed an image into an HTML page. It’s an empty tag (no closing tag). Requires the src attribute (specifies the image source/path) and the alt attribute (alternative text for the image).

Example: <img></img>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

src Attribute

A

Used with the <img></img> tag to specify the path or URL of the image file to be displayed.

Example: src=”images/photo.jpg” or src=”https://example.com/image.png”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

alt Attribute

A

Used with the <img></img> tag to provide alternative text for an image. This text is displayed if the image cannot load and is read by screen readers for accessibility. It also helps search engines understand the image content.

Example: alt=”A smiling Corgi puppy”

17
Q

Unordered List (<ul>)

A

Defines an unordered (bulleted) list. Each item within the list is defined using an <li> (list item) tag.

Example: <ul><li>Coffee</li><li>Tea</li></ul>

18
Q

Ordered List (<ol>)

A

Defines an ordered (numbered or lettered) list. Each item within the list is defined using an <li> (list item) tag.

Example: <ol><li>Step 1</li><li>Step 2</li></ol>

19
Q

<li> Tag
</li>

A

Defines a list item inside an ordered list (<ol>) or an unordered list (<ul>).

20
Q

<div> Tag
</div>

A

A generic block-level container element. It’s often used to group larger sections of content for styling with CSS or manipulation with JavaScript. It has no semantic meaning by itself.

21
Q

<span> Tag</span>

A

A generic inline container element. It’s often used to group small parts of text or other inline elements within a block-level element, usually for specific styling or targeting with JavaScript. It has no semantic meaning by itself.

22
Q

HTML Comments

A

Used to insert comments into the HTML source code. Comments are ignored by the browser and are not displayed on the page. Useful for explaining code or temporarily removing code blocks. Syntax: ``.

23
Q

Semantic HTML

A

Using HTML elements according to their meaning, rather than just for presentation. Examples include <header>, <footer>, <nav>, <article>, <section>, <aside>. Improves accessibility, SEO, and code readability.

24
Q

Block-level vs. Inline Elements

A

Block-level elements typically start on a new line and take up the full width available (e.g., <h1>, <p>, <div>, <ul>). Inline elements do not start on a new line and only take up as much width as necessary (e.g., <a>, <span>, <img></img>, <strong>).</strong></span></a>

25
Q

HTML vs. CSS vs. JavaScript

A

HTML provides the structure/content. CSS (Cascading Style Sheets) controls the presentation/styling. JavaScript adds interactivity/dynamic behavior. They work together to create modern web pages.

26
Q

How is a basic HTML page structured? Visualize the hierarchy.

A

Think of it as nested boxes:
<!DOCTYPE html> <html> <head> <meta></meta>
<title>Page Title (shows in tab)</title>
</head>

<body> <h1>Main Heading</h1>
<p>Paragraph text...</p>
</body>

</html>

Key Points: <!DOCTYPE html> is first. <html> wraps everything. <head> and <body> are children of <html>. <head> contains info about the page, <body> contains displayed content.