Lecture 5: CSS: Text Properties, Line Box, Css
Lecture 5: CSS: Text Properties, Line Box, Css
Each character is drawn relative to a rectangular character cell (also known as the
character’s content area)
Cell Height
M Baseline Height
Baseline
Font Families
The fonts within a font family differ from one another in attributes such as
boldness and font-size.
G Line Height
CSS Text Properties
text-decoration: underline, overline, line-through.
letter-spacing: additional space to be included between adjacent
letters in words. Negative value indicates space to be removed.
word-spacing: additional space to be included between adjacent
words. Negative value indicates space to be removed.
text-indent: Specify for block elements and table cells to indent text within first
line box
text-align: left, right, center, justified.
Text Color
Color Name RGB Value
Black #000000
Gray #808080
Silver #c0c0c0
White #ffffff
Red #ff0000
Lime #00ff00
Blue #0000ff
Yellow #ffff00
Maroon #800000
Next Class
CSS Box Model
If one HTML element is part of the content of a second HTML element, then the
box corresponding to the first element will be contained within the content area of
the box for the second element.
<head>
<title>Hello World </title>
</head>
<body>
</body>
</html>
Normal Flow Box Layout
Width: each block element has a width property that defines the width of the
content area of the element’s block box.
The default value is auto: the box will be stretched so that its left and right outer
edges align with the left and right content edges of its parent box.
In order to center the child element, you must specify: margin-left: auto;
margin-right: auto;
Normal Flow Box Layout
Height: the height of a box is determined by its content. It is sufficient to contain
all the contents with an element box.
If the top or bottom of an inline box extends beyond the corresponding edge of the
line box, the line box height will automatically be expanded as needed.
Style properties
◦ Lists
◦ Tables