Search Header Logo
Weblab Lesson 18

Weblab Lesson 18

Assessment

Presentation

Computers

8th Grade

Practice Problem

Easy

Created by

Margaret Maloney

Used 1+ times

FREE Resource

3 Slides • 11 Questions

1

media

Anchor Tag States

An anchor (<a>) tag has four states:

  1. link: when the link has not yet been clicked

  2. visited: when the link has been clicked (clicking a link "visits" that linked page, hence the name "visited")

  3. hover: when the mouse is hovered over, but not clicked, the link

  4. active: the moment the mouse is actively clicking down on the link

We style these states using pseudo-classes. In the example below, we specify the anchor element selector, a colon, and the name of the anchor state:

2

Multiple Choice

An anchor tag has _____ states.

1

10

2

4

3

26

4

12

3

Multiple Choice

The link state of an anchor tag is when:

1

there is no link

2

the link has already been clicked

3

the link is invisible

4

the link has not yet been clicked

4

Multiple Choice

The visited state of an anchor tag is:

1

the link has NOT been clicked

2

aliens visited the link

3

when the link has been clicked

4

the link is invisible

5

Multiple Choice

The hover state of an anchor tag is:

1

when the link is clicked

2

when the mouse is hovered over, but not clicked, the link

3

when the link is invisible

4

when aliens use a hover board

6

Multiple Choice

The active state of an anchor tag is:

1

the moment the mouse is invisible

2

the moment the mouse eats the cheese

3

the moment the mouse is actively clicking down on the link

4

the moment

7

Section 2:
The CSS rule-set below shows that once the link has been clicked to visit the site:
The link color will turn to purple.
The font-size will change to 30 pixels.
___________________________

a:visited{

color:purple;

font-size: 30px;

}

8

Multiple Choice

Which answer describes what will happen in this CSS rule set?

a:visited{

color:purple;

font-size: 30px;

}

1

The link will turn purple and change to a font size of 30 pixels once the link has been clicked.

2

The link will remain the same no matter what.

3

The link will turn purple, but the font will remain the same.

4

The font size will change, but the link color will remain the same.

9

Multiple Choice

What does the CSS rule set below do?

a:hover{

color: chocolate;

background-color: aquamarine;

font-size: 32px;

1

When you hover over a link the color of the text turns chocolate and the background color is aquamarine. The font size will change to 32 pixels.

2

When you hover over a link nothing happens.

3

When you hover over the link the background color changes to chocolate.

4

Aliens invade the earth.

10

Anchor Pseudo-class Order

It is recommended that if you are going to use all four states for an anchor tag, you create your rule sets in CSS in the following order:

  1. link

  2. visited

  3. hover

  4. active

Setting these out of order on your CSS can create unforeseen actions as the cascading style of CSS can have one property overriding another. In short, if there are competing rule sets, styles declared later typically override those declared earlier.

One way to remember the right order is with the phrase "LOVE, HATE" - LV, HA (Link, Visited, Hover, Active).

11

Dropdown

One way to remember the right order is with the phrase "LOVE, HATE" - LV, HA (Link, Visited, Hover, Active).

12

Multiple Choice

Setting CSS rule sets out of order can have unforeseen effects. This is because:

1

if there are competing rule sets, styles declared later typically override those declared earlier.

2

if there are competing rule sets, styles declared earlier typically override those declared later.

3

Aliens invaded

13

Dropdown

Does the order of the CSS rules sets matter when you are using the four states of anchor tags ?​

14

Multiple Choice

Which is the correct order to code the CSS rule set for the different states of the anchor tags?

1

Active

Hover

Link

Visited

2

Visited

Hover

Link

Active

3

Link

Hover

Active

Visited

4

Link

Visited

Hover

Active

media

Anchor Tag States

An anchor (<a>) tag has four states:

  1. link: when the link has not yet been clicked

  2. visited: when the link has been clicked (clicking a link "visits" that linked page, hence the name "visited")

  3. hover: when the mouse is hovered over, but not clicked, the link

  4. active: the moment the mouse is actively clicking down on the link

We style these states using pseudo-classes. In the example below, we specify the anchor element selector, a colon, and the name of the anchor state:

Show answer

Auto Play

Slide 1 / 14

SLIDE