Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cascading Style Sheets

Similar presentations


Presentation on theme: "Cascading Style Sheets"— Presentation transcript:

1 Cascading Style Sheets
Text Controls

2 Tracking Amount of space between words and letters (kerning = space between letters, usually pair-wise). CSS uses word-spacing: and letter-spacing: Helps to improve readability

3 letter-spacing length value such as .2em; 8px; normal
h2{letter-spacing : .3em;} this adds .3 em to normal spacing (so approx = 1.3 em) Positive values add more space; negative values close up the space

4 word-spacing Changes the spacing between words length value normal
word-spacing: 8px; Like letter-spacing, a positive value increases white space and a negative value lessens space.

5 line-height Used to adjust the spacing between lines
Use percent or ems: line-height: 100%; line-height: 1.5em; a number which is then multiplied by the font size to get the spacing; line-height: 1.5 A length value (such as line-height: 24px;) normal line-height: 2.0; or line-height:200% will double space. Often combine with font-size: font: 12px/14px serif;

6 Setting Text Case text-transform: text-shadow (in CSS 3)
small-caps (uppercase, the first letter is larger) uppercase lowercase none text-shadow (in CSS 3)

7 Text Alignment-Horizontal
left right center justify

8 Text Alignment - Vertical
vertical-align: super (used for superscripting) sub (used for subscripting) baseline (natural state) relative value sets the alignment relative to the parent –top, middle, bottom, text-top and text-bottom percentage – raises or lowers the baseline proportional to the parent

9 Paragraph Indentation
text-indent length value e.g. .intro {text-indent: 2em;} percentage (proportionate to the paragraph’s width)

10 Controlling White Space
p {white-space: pre;} which preserves the multiple line settings h2{white-space: nowrap;} Prevents line wrapping, no break tag <br/> :normal

11 Text Decoration Used for emphasis text-decoration: underline overline
line-through None So often see a:link {text-decoration: none;} a:hover {text-decoration: underline;}

12 Text direction For non-Western languages direction:


Download ppt "Cascading Style Sheets"

Similar presentations


Ads by Google