2.1 Hyperlinks Flashcards

(10 cards)

1
Q

What is the <a> tag used for?</a>

A

The <a> (anchor) tag creates a hyperlink that navigates to another page, section, or resource.</a>

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

What does the href attribute in <a> specify?</a>

A

It defines the destination URL or file path for the hyperlink.

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

What is an absolute path in a hyperlink?

A

A full URL including the domain name (e.g, https://example.com/page.html).

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

What is a relative path in a hyperlink?

A

A path relative to the current file, e.g, about.html or ../folder/page.html.

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

How do you link to an external website using HTML?

A

Use <a> Visit Site</a>.

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

How do you link to another page within your own project?

A

Use a relative path, e.g, <a> Contact</a>.

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

How do you link to a specific section within a page?

A

Use an ID selector, e.g, <a> GO the Section 2</a>.

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

How do you define a section anchor target?

A

Add an id attribute to an element, e.g, <h2 id="section2">Section 2</h2>.

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

How do you make a link open in a new tab?

A

Add target=”_blank” to the <a> tag.</a>

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

What are some security best practices with target=”_blank”?

A

Add rel=”noopener noreferrer” to prevent security vulnerabilities.

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