HTML & CSS- part 5 Flashcards

1
Q

How do you center an image?

A

Use these in a class, ID, or CSS statement:
display: block;
margin-left: auto;
margin-right: auto;

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

What can you use instead of:
margin-left: auto;
margin-right: auto;

A

margin: 0 auto 0 auto;

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

What does float mean when working with an image?

A

Wrapped text. So if you float the image to the right, then the text will be on the left and vice versa:
float: right;

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

How do you stop wrapping text?

A

Cancel out the float with

p {clear: both;}

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

How is a link displayed by default?

A

in blue with an underline

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

What does href stand for?

A

Hypertext Reference

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

What is href telling the browser?

A

“Watch for an address immediately following the equal sign.
Go there page to load when the user clicks the anchor.”

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

How would you type a link to stackoverflow.com from another site?

A

<a>Stack Overflow</a>

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

In this link, what is the anchor?
<a>Stack Overflow</a>

A

The anchor is “Stack Overflow”

The anchor is the link text between the opening <a> tag and the closing </a> tag.
It is the text that the user sees.

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

If you’re linking to a page on the same website and in the same folder, do you have to use the full address?

A

No. You can just use the page name.

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

How do you link to a page on the same website but in a different folder?

A

Add the subdirectory name:
“catalog/products.html”

In this case, the subdirectory is “catalog”

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

What is domain name and example?

A

The unique name that appears after the @ sign in email addresses, and after www. in web addresses.

peta.org

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

What does this mean?

../

A

It’s used in the HREF to go up one directory level

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

If you’re linking to the same site you are on, do you need a / in from of the subdirectory?

A

No

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

Code an opening tag that links to the subdirectory PETS that’s on the same level as the subdirectory you’re linking from. The page is CATS.HTML

A

<a href=”../pets/cats.html”>

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

In a web address, what goes in front of the www?

A

http://

17
Q

How do you link to a specific place on the current page ?

A
  1. put an ID name in the destination tag like this: <p id=”target”>You have arrived at the destination tag</p>
  2. Then refer to that ID in the “doorway” tag like this: <a href=”#target”>click here to go to the destination tag</a>
18
Q

How do you link to a specific place on a different page?

A

Same process as linking to a target on the current page, except you need to include the page name:
<a href=”index.com#target”>

*If it’s on a different website, you need to include the domain name, too.

19
Q

How do you code a link so that it opens in a new window?

A

This is the code: target=”_blank”

Used like this:
/<a href=”http://www.y.org” target=”_blank”>

20
Q

How do you style a link?

A

\ a {/*code goes here}