HTML Basics Flashcards

1
Q

How does a typical document begin?

A

<!DOCTYPE html>

<html>
<head>
<title>This is the title</title>
</head>
<body>
<h1>This is the heading</h1>
</body>
</html>

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

What is <p></p>?

A

A paragraph tag (or element)

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

In <p id="myId" class="my-class"></p>, what does id and class represent?

A

Attributes (they include key and value)

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

What is semantic html?

A

Elements that imply meaning to content; easier to understand structure of html (eg h1, section, article, aside, header, nav, footer, ol, ul, li, etc); crucial for SEO and accessibility
1. article: self-contained; independently distributable
2. section: thematic grouping of content, not self-contained
3. header: introductory content; top of document
4. main: main content, one per page
5. nav: section of links
6. aside: indirectly related, non-vital content
7. footer: footer of document

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

How can you display “<”, “>” or “&” in an html document?

A

Use &lt;, &gt; and &amp;, respectively (these are called html entity references)

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

What additional attributes should you add to an a tag for external links?

A

target="_blank" rel="noopener noreferrer"

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

Which tags are self-closing?

A

<input></input>

<hr></hr>

(horizontal rule)
<br></br> (line break)
<img></img>

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

How do you make a comment in html?

A

<!-- my comment here -->

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

How do you display an image?

A

<img></img>

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

How you create a link?

A

<a>Something</a>

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

How do you add italics or bold text using html?

A

<em> </em>
<strong> </strong>

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

How do you create a table?

A

<table>
<thead>
<tr>
<th>My heading</th>
</tr>
</thead>
<tbody>
<tr>
<td>My content</td>
</tr>
</tbody>
</table>

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

How do you create a form?

A

<form>
<label>Username</label>
<input></input>

<label>Password</label>
<input></input>

<button>Submit</button>
</form>

// name is used for submitting form
// other types include “data”, “tel”, “checkbox”, “radio”

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

How do you create a group of radio buttons?

A

<fieldset>
<legend>Choose your animal</legend>

<label>Dog</label>
<input></input>

<label>Cat</label>
<input></input>
</fieldset>

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

What does a common html head include?

A

<head>
<meta></meta>
<meta></meta>
<title>This is the title</title>

<link></link>
<base></base>

<meta></meta>
<meta></meta>
</head>

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