HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 9. CSS: THE STYLE SHEET 94


If you want to, you can redefine to have no boldness by using this
directive.


b { font-weight: normal; }


9.7 font-style: (normal, italic)


font-style: can be normal, italic, or oblique (which means the same as
italic).


Exam Question 167(p.346): What CSS attribute: sets the slant of your
lettering?
Required Answer:font-style:


You could even redefineto have no slant by using this directive.


i { font-style: normal; }


9.8 text-align: (left, right, center, justify)


Text can be centered, or it can be justified to the left, to the right, or to
both sides of the column. Thetext-align: attribute can have a value of
left, right, center, or justify.


Old-style HTML might show things like

. The old style is depre-
cated. Do not use it.


text-align: center; / ragged left and right /
text-align: left; / straight left, ragged right /
text-align: right; / ragged left, straight right /
text-align: justify; / straight left and right /


Exam Question 168(p.346): List the four “text-align:” options.
Required Answer:left, right, center, justify


To center the text of all paragraphs, we can do this.


p { text-align: center; }