Text and Font Styles Flashcards

1
Q

What will be the output of the following CSS?

p {
    font-weight: bold;
}
<p>Hello World!</p>
A

The text “Hello World!” will be bold.

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

How do you make the text inside this <h1> element blue?
HTML

<h1>Welcome</h1>
A
h1 {
    color: blue;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Write the CSS rule to make all <p> elements italic.

A
p {
    font-style: italic;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What CSS property is missing in this code to make the text underlined?

p {
    _ : underline;
}
A
text-decoration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Fix the error in this CSS rule to correctly center-align text inside <div>.

div {
    text-align: middle;
}
A
div {
    text-align: center;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What will be the result of this CSS on the <p> element?

p {
    text-transform: uppercase;
}
<p>hello world</p>
A

The text will be displayed as “HELLO WORLD”

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

How do you apply a text shadow effect to this heading?
HTML

<h1>Shadow Effect</h1>
A
h1 {
    text-shadow: 2px 2px 4px gray;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Write the CSS rule to give a paragraph both letter-spacing of 3px and word-spacing of 6px.

A
p {
    letter-spacing: 3px;
    word-spacing: 6px;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does this CSS do?

p {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
A

It truncates overflowing text and adds an ellipsis (…).

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

What CSS property should be added to break long words inside this div?

div {
    width: 200px;
    border: 1px solid black;
}
A
word-break: break-word;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What will be the result of this CSS rule?

p {
    font-variant: small-caps;
}
<p>Web Development</p>
A

The text will be displayed as “WEB DEVELOPMENT” but with lowercase letters in small caps.

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

Which CSS rule correctly applies a right-to-left text direction?

<p>مرحبا بالعالم</p>
A

css

p {
    direction: rtl;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Write a CSS rule that makes text vertical and aligned from right to left.

A
p {
    writing-mode: vertical-rl;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does this CSS do?

p {
    font-feature-settings: "liga" 1;
}
A

It enables ligatures in fonts that support them.

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

Fix the mistake in this CSS rule:

h2 {
    font-variant-position: superscript;
}
A
h2 {
    font-variant-position: super;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What happens if you apply this CSS?

span {
    font-variant-numeric: oldstyle-nums;
}
<span>12345</span>
A

The numbers will appear in an old-style numeral format.

17
Q

Write a CSS rule to apply discretionary ligatures to text.

A
p {
    font-variant-ligatures: discretionary-ligatures;
}
18
Q

How do you ensure text maintains legibility with optimized rendering?

A
p {
    text-rendering: optimizeLegibility;
}
19
Q

What will happen with this CSS applied?

p {
    overflow-wrap: break-word;
}
<p>Thisisaverylongwordwithoutanyspaces.</p>
A

The word will break to fit within the container.

20
Q

Which CSS property allows you to control whether hyphens appear automatically?

A
hyphens: auto;