Attributes , Paragraph and Heading Flashcards

(33 cards)

1
Q

What is the primary function of attributes in an HTML document?

A

They provide additional information about HTML elements.

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

In which part of an HTML element must attributes always be defined?

A

Attributes are always defined in the opening tag of an element.

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

Attributes are always written in _____ pairs inside the opening tag of an element.

A

name-value

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

What is the recommended case for writing HTML attribute names and values?

A

It is recommended to write both attribute names and values in lowercase.

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

How should multiple attributes be separated within a single HTML element’s opening tag?

A

Multiple attributes must be separated by a space.

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

What is the function of the href attribute, typically used with anchor tags?

A

The href attribute defines the URL of the web page to which the link goes.

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

What information does the src attribute provide for an image element?

A

The src attribute provides the URL of the image to be embedded in the document.

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

Term: Absolute URL (in an src attribute)

A

Definition: A URL that points to an image hosted on an external website, providing the full web address.

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

Term: Relative URL (in an src attribute)

A

Definition: A URL that points to an image file located within the same system or website, providing a local path.

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

What is the main advantage of using relative URLs over absolute URLs for images?

A

Relative URLs are not dependent on an external source, which prevents broken images if the external source deletes the image.

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

What do the width and height attributes specify for an HTML image element?

A

They specify the width and height of an image, respectively, typically in pixels.

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

What is the purpose of the alt attribute in an <img> tag?

A

The alt attribute specifies alternate text for an image, which is displayed if the browser cannot render the image.

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

What does the dir attribute control in an HTML element?

A

The dir attribute determines the text direction of the element’s content.

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

The dir attribute can have three values: ltr, rtl, and _____.

A

auto

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

What is the default text direction for elements in HTML, corresponding to the ltr value?

A

The default text direction is left-to-right.

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

What is the function of the style attribute in an HTML element?

A

The style attribute allows you to write inline CSS to add styling to an element.

17
Q

What is the purpose of the title attribute in an HTML element?

A

The title attribute defines extra information about an element, which appears as a tooltip on mouse-over.

18
Q

What information is declared by the lang attribute in an HTML document?

A

The lang attribute is used to declare the language of the web page.

19
Q

The lang attribute’s value often consists of two parts; what do they typically define?

A

The first two characters define the language, and the last two characters define the country.

20
Q

What are the <h1> through <h6> tags used for in HTML?

A

They are used to define headings, with <h1> being the most important and <h6> being the least important.

21
Q

Which heading tag is considered the most important and is typically displayed the largest by browsers?

A

The <h1> tag.

22
Q

Which heading tag is considered the least important and is typically displayed the smallest by browsers?

A

The <h6> tag.

23
Q

How do heading elements behave in the flow of an HTML document?

A

Heading elements are block-level elements, meaning each new heading starts on a new line.

24
Q

Why are headings important for search engines?

A

Search engines use headings to index the structure and content of a webpage.

25
How can the default size of an HTML heading be changed?
The size can be changed using the `style` attribute combined with the CSS `font-size` property.
26
What is the function of the `

` tag in HTML?

The `

` tag is used to define a paragraph of text.

27
Although a `

` tag may work without a closing tag, what is the recommended best practice?

It is best practice to always include the closing `

` tag to avoid browser incompatibilities.
28
How does an HTML browser treat extra blank spaces added between words inside a `

` tag?

The browser ignores the extra blank spaces, rendering only a single space.
29
What HTML entity code can be used to force a single blank space in a paragraph?
The ` ` entity, which stands for non-breaking space.
30
How does an HTML browser treat text that is written on multiple lines within the `

` element in the source code?

The browser collapses the multiple lines and displays them as a single line.
31
Which HTML tag is used to insert a line break within a paragraph or other element?
The `
` tag is used to insert a line break.
32
What does the `
` tag represent in HTML?
The `
` tag represents preformatted text, where spaces and line breaks in the code are preserved in the output.
33
What problem common with `

` tags is solved by using the `

` element?
The `
` element solves the problem of browsers ignoring extra spaces and line breaks, making it easy to display multiline text.