Preparing html Flashcards

1
Q

What must you start your webpage with?

A

A declaration
e.g. <!DOCTYPE html>

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

How do you create html structure and content?

A

To create HTML structure and content, we must add opening and closing <html> tags after declaring <!DOCTYPE html>

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

What element contains the metadata for a web page?
And should its location be?

A

<head> </head>

Above the <body> tag.
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

How would you name your browser’s tab?

A

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

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

What element is used to add links to a webpage?
And what is the required attribute?

A

You can add links to a web page by adding an anchor element <a>.
The required attribute is href=” “
e.g.
<a>This Is A Link To Wikipedia</a></a>

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

What does the ‘target’ attribute specify?

A

The target attribute specifies how a link should open.

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

How do you make a link open a new window?

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.
e.g. target=”_blank”

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

What is the difference between a relative path and an absolute path?

A

A relative path is a filename that shows the path to a local file. e.g. ./index.html
Absolute path (a full URL, like https://www.codecademy.com/learn/learn-html which is stored in a different folder.
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 would you make an image a link?

A

You would wrap the element with an anchor element like so e.g.
<a> <img></img> </a>

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

How would you link a target to the same page?

A

In order to link to a target on the same page, we must give the target an id attribute and a unique value.
e.g.

<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.
e.g.

<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

What is used to make reading code easier?

A

White space and indentation.
two spaces before a line e.g.

<body>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
</body>

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

How do you add comments to your code?
And why are they helpful?

A

Comments begin with <!-- and end with -->
Any characters in between will be ignored by your browser.
So you and others can come back and review at a later date.
They allow you to experiment with new code, without having to delete old code.

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