HTML Document Standards Flashcards

1
Q

why do you need a <!DOCTYPE html>

A

It tells the browser what type of document to expect,

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

why do you need the <html> tag

A

Anything between the opening <html> and closing </html> tags will be interpreted as HTML code

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

what is the < head >

A

The <head> element contains the metadata for a web page. Metadata is information about the page that isn’t displayed directly on the web page.

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

why is <title> within the <head></title>

A

A browser’s tab displays the title specified in the <title> tag. The <title> tag is always inside of the <head>.</title></title>

<html>
<head>
<title>My Coding Journal</title>
</head>
</html>

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

explain linking to webpage using <a></a>

A

You can add links to a web page by adding an anchor element <a> and including the text of the link in between the opening and closing tags.</a>

<a>This Is A Link To Wikipedia</a>

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

what does the target and _ blank element do

A

For a link to open in a new window, the target attribute requires a value of _blank. The target attribute can be added directly to the opening tag of the anchor element, just like the href attribute.

<a>The Brown Bear</a>

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

what is the root directory

A

hen making multi-page static websites, web developers often store HTML files in the root directory, or a main folder where all the files for the project are stored. As the size of the projects you create grows, you may use additional folders within the main project folder to organize your code.

project-folder/
|—— about.html
|—— contact.html
|—— index.html

TML files are often stored in the same folder, as shown in the example above. If the browser is currently displaying index.html, it also knows that about.html and contact.html are in the same folder. Because the files are stored in the same folder, we can link web pages together using a relative path.

<a>Contact</a>

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

what does the ./ do for index Html

A

the ./ in ./index.html tells the browser to look for the file in the current folder.

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

how do you use the Img element to make a image a hyperlink

A

by simply wrapping the <img></img> element with an <a> element.</a>

<a><img></img></a>

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

how do we allow user to press a link to a specific section of the page

A

n order to link to a target on the same page, we must give the target an id, like this:

<p>This is the top of the page!</p>

<h1>This is the bottom! </h1>

The target link is a string containing the # character and the target element’s id.

<ol>
<li><a>Top</a></li>
<li><a>Bottom</a></li>
</ol>

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

how do you make a comment using <!-- -->

A

<!-- Favorite Films Section -->

<p>The following is a list of my favorite films:</p>

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

recap

A

The <!DOCTYPE html> declaration should always be the first line of code in your HTML files. This lets the browser know what version of HTML to expect.

The <html> element will contain all of your HTML code.

Information about the web page, like the title, belongs within the <head> of the page.

You can add a title to your web page by using the <title> element, inside of the head.

A webpage’s title appears in a browser’s tab.
Anchor tags (<a>) are used to link to internal pages, external pages or content on the same page.

You can create sections on a webpage and jump to them using <a> tags and adding ids to the elements you wish to jump to.

Whitespace between HTML elements helps make code easier to read while not changing how elements appear in the browser.

Indentation also helps make code easier to read. It makes parent-child relationships visible.

Comments are written in HTML using the following syntax: <!-- comment -->.

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