HTML and CSS Reference
In-Depth Information
Thought experiment
Altering styles
In this thought experiment, apply what you've learned about this objective. You can
find an answer to this question in the “Answers” section at the end of this chapter.
CSS provides the ability to make websites look great. In some cases, you may want
to alter the styles based on user input or actions. How would you alter the styles of
your page in this fashion?
■
CSS3 provides the ability to style the appearance of text in the following ways:
■
Changing the color with the
color
property
■
Changing the text to bold with the
font-weight
property
■
Changing the text to italics with the
font-style
property
■
Changing the font type with the
font-family
property
■
Changing the size of the text with the
font-size
property
■
CSS3 provides the ability to style the alignment of text with the
text-align
property.
■
CSS3 provides the ability to alter text indentation with the
text-indent
property.
■
CSS3 provides the ability to alter the spacing between letters and the spacing between
words with the
letter-spacing
and
word-spacing
properties.
■
CSS3 allows you to control how text hyphenates when the text needs to wrap within
the boundaries of its container.
Answer the following questions to test your knowledge of the information in this objective.
You can find the answers to these questions and explanations of why each answer choice is
correct or incorrect in the “Answers” section at the end of this chapter.
Which of the following CSS would not change the appearance of text?
A.
font-style: italic;
B.
font-weight: heavy;
C.
font: bolder 12px arial;
D.
color: green;
1.
Search WWH ::
Custom Search