1.5 Attributes Flashcards

(8 cards)

1
Q

What are HTML attributes?

A

Additional information added to elements using name/value pairs (e.g, id=”main”).

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

How do you set the language of an HTML document?

A

With the lang attribute in <html lang="en">.

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

What does the title attribute do?

A

It provides extra information shown as a tooltip on hover.

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

What is the id attribute used for?

A

Assigns a uniqe indentifier to an HTML element, useful for CSS & JavaScript.

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

What is the class attribute used for?

A

Assigns one or more class names to an element for styling & scripting.

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

Can an element have both id & class attributes?

A

Yes, an element can have both for unique targeting & shared styles.

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

Are HTML attribute values case-sensitive?

A

Attribute names are not case-sensitive, but values may be, depending on context.

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

What is the syntax for writing an attribute?

A

attribute=”value” inside an opening tag, e.g, <p title="Hello">.

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