HTML CARDS Flashcards

(23 cards)

1
Q

HTML

A

Explanation: HyperText Markup Language that structures web content.

Breakdown: It uses tags (like <p>) to tell browsers how to display text, images, and links.

Example: A simple page with <!DOCTYPE html>, <html>, <head>, and <body>.

Key Points:
Declares document type <!DOCTYPE html>.
Main sections: <head> and <body>.
Works with CSS (style) and JS (behavior).

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

HTML Elements

A

Explanation: A piece of content wrapped by a start and end tag (e.g., <p>…</p>).

Breakdown: Acts like a container that defines headings, paragraphs, or links.

Example: <h1>Title</h1> shows a level‑1 heading.

Key Points:

Consists of a start tag, content, and an end tag.
Some are self-closing (<br></br>, <img></img>).
Elements can nest.

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

Nested Elements

A

Explanation: Placing one element inside another to build structure.

Breakdown: Like boxes in boxes; for example, a <strong> tag inside a <p>.</strong>

Example: <p>This is <em>emphasized</em> text.</p>

Key Points:
Inner elements must close before outer.
Improves semantic structure.
Use indentation for readability.

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

Headings

A

Explanation: Six levels of titles (<h1>–<h6>) to structure content.

Breakdown: <h1> is a top-level title; smaller numbers mean less importance.

Example: <h2>Section title</h2>

Key Points:
Block-level, bold by default.
Aids SEO and accessibility.

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

Empty Elements

A

Explanation: Elements that don’t enclose content (self-closing).

Breakdown: They perform actions (line break, image) without text inside.

Example:<br></br>, <img></img>, <hr>.

Key Points:
No closing tag.
Often need attributes like src or alt.

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

Paragraphs

A

Explanation: <p> defines a block of text as a paragraph.

Breakdown: Separates ideas into readable blocks with space before/after.

Example: <p>This is a paragraph.</p>

Key Points:
Block-level element.
Browsers add spacing.

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

Line Break (<br></br>)

A

Explanation: Inserts a line break without starting a new paragraph.

Breakdown: Moves content down one line like pressing Enter.

Example: Line 1<br></br>Line 2

Key Points:
Self-closing.
No extra margin.
Use sparingly.

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

Formatting Tags

A

Explanation: <b>/<strong> and <i>/<em> style text visually vs. semantically.</em></i></strong></b>

Breakdown: <b> and <i> change appearance; <strong> and <em> add meaning.</em></strong></i></b>

Example: <strong>Important</strong> vs <b>Bold</b>

Key Points:
Prefer <strong>/<em> for meaning.
<b>/<i> for purely visual changes.</i></b></em></strong>

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

Attributes

A

Explanation: Settings inside tags (name=”value”) that configure elements.

Breakdown: Like options: href for links, src for images, and alt for alt text.

Example: <a>Link</a>

Key Points:
Written in the opening tag.
Use quotes around values.
Boolean attributes (e.g., disabled) omit values.

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

href Attribute

A

Explanation: Specifies a link’s destination URL.

Breakdown: Found in <a> tags: external, internal, email, or anchor links.</a>

Example: <a>Jump</a>

Key Points:
mailto: for emails
Use relative paths for local links

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

src Attribute

A

Explanation: Defines source URL for media (images, videos, scripts).

Breakdown: Tells the browser where to fetch the file.

Example:<img></img>

Key Points:
Required for <img></img>, <video>,

, <iframe>.
Often paired with alt or type.
</video>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Image Links

A

Explanation: Clickable images by wrapping <img></img> in <a>.</a>

Breakdown: Combines link destination and image display.

Example: <a><img></img></a>

Key Points:
Keep alt and href.
Use target if needed.

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

Image Tags

A

Explanation: <img></img> embeds images; needs src and alt.

Breakdown: No closing tag, shows picture on page.

Example: <img></img>

Key Points:
Always include alt text.
Can set dimensions.

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

Iframes

A

Explanation: <iframe> embeds another page/document inside.

Breakdown: Acts as a window to another URL.

Example: <iframe src="video.html" width="600" height="400"></iframe>

Key Points:
Use titles for accessibility.
Not all sites allow embedding.

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

Lists

A

Show items: <ul> bulleted, <ol> numbered, <dl> description.

Breakdown: Use <li> for list items and <dt>/<dd> for terms and definitions.

Example: <ul><li>Item</li></ul>

Key Points:
Can nest lists.
Style with CSS.

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

Tables

A

Explanation: <table> organizes data in rows <tr>, cells <td>, headers <th>.

Breakdown: Use for tabular data. Add borders or styling as needed.

Example: <table border="1"><tr><th>Name</th></tr></table>

Key Points:
Optional <thead>, <tbody>, <tfoot>.
colspan and rowspan for merging.

15
Q

Special Elements

A

Explanation: Tags like <!DOCTYPE>, <meta></meta>, <title>, <style>,

 that configure the document.
</style></title>

Breakdown: Found in <head>, define page type, encoding, styles, and scripts.

Example: <meta></meta>

Key Points:
<!DOCTYPE html> declares HTML5.

<meta></meta>

makes pages responsive.

16
Q

lang Attribute

A

Explanation: Declares content language (e.g., en, es).

Breakdown: Helps browsers and screen readers handle text correctly.

Example: <html lang="en">

Key Points:
Improves accessibility and SEO.
Can apply to individual elements.

17
Q

title Attribute

A

Explanation: Shows a tooltip on hover with extra info.

Breakdown: Useful for clarification or hints.

Example: <p title="More info">Text</p>.

Key Points:
Not visible until hover.
Keep text brief.

18
Q

HTML Comment Tags

A

Explanation: <!-- comment --> to leave notes in code.

Breakdown: Hidden from users, only visible in source.

Example: <!-- TODO: update link -->

Key Points:
Do not nest comments.
Use for documentation or temporary disabling.

19
Q

CSS Methods

A

Explanation: Three ways to add CSS: inline, internal, and external.

Breakdown: inline via style, internal in <style> tag, external in .css file.</style>

Example: <link></link>

Key Points:
External is best for multiple pages.
Inline for quick, one-off tweaks.
Internal for single-page styles.

20
Q

class vs. id

A

Explanation: Class groups elements; ID identifies one unique element.

Breakdown: Classes reusable; IDs unique.

Example: <div class="box"> vs <h1 id="main-title">

Key Points:

CSS selectors .classname and #idname
Use classes for shared styles
Use IDs for one-time hooks or anchors.

21
Q

Colors (RGB & Hex)

A

Explanation: Define colors by numeric codes: rgb() or hex #RRGGBB.

Breakdown: RGB uses three 0–255 values; hex uses pairs of hex digits.

Example: color: rgb(255,0,0); or color: #FF0000;

Key Points:
Many formats: names, RGB, hex, HSL
Hex shorthand (#F00) for some colors.
Use CSS for consistent styling.