Attributes Flashcards

1
Q

What are the two parts of an HTML attribute.

A

name=”value”

Eg, align=”center”

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

Align attribute and its values

A

align=”left”
align=”center”
align=”right”

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

What are the four core attributes?

A

id
title
class
style

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

What is the use of the id attribute?

A

Uniquely identify any element within an HTML page. You can thus identify a single specific element and its content, including distinguishing between elements with the same name within the same web page or style sheet.

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

Give an example of the id attribute.

A

<p>This paragraph explains what HTML is...</p>

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

What is the use of the title attribute?

A

Similar to the id attribute but the behaviour can change depending on the element type to which it is assigned. Often also displays tooltips when cursor is hovering over the content.

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

What is the use of the class attribute?

A

Associate an element with a style sheet and specifies the class of the element.

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

How many values can the class attribute have?

A

Multiple values as a space-separated list of class names. Eg, class=”className1 className2 className3”

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

What is the use of the style attribute?

A

Specify CSS rules within the element.

Eg, <p style="font-family: arial; color: #FF0000;">Some red arial text…</p>

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

What are the three internationalisation attributes?

A

dir
lang
xml:lang

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

What is the use of the dir attribute?

A

Indicate to the browser the direction in which the text should flow.

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

What are the value of the dir attribute?

A

dir=”ltr” (ltr = left-to-right)

dir=”rtl” (rtl = right-to-left)

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

What is the use of the lang attribute?

A

Indicate the lang attribute but only for backwards compatibility with earlier HTML versions.

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

What is the use of the xml:lang attribute?

A

Same as lang (indicate language) but for XHTML

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

What are the values of lang and xml:lang attributes?

A

ISO-639 standard two-character language codes

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

Attribute to horizontally align tags

A

align=”left”
align=”center”
align=”right

17
Q

Attribute to vertically align tags within an HTML element

A

valign=”top”
valign=”middle”
valign=”bottom”

18
Q

Attribute to place a background colour behind an element.

A

bgcolor=””

Numeric, hexadecimal, or RGB values

19
Q

Attribute to place a background image behind an element.

A

background=”URL”

20
Q

Attribute to specify the height of tables, images, or table cells.

A

height=”numeric value”

21
Q

Attribute to to specify the width of tables, images, or table cells.

A

width=”numeric value”