1 / 18

Changing Text with CSS

Changing Text with CSS. Styling Text. Can emphasize words on a page Change Font Size Indent Text Change the Font Change Text Alignment Control Line Spacing Control Letter Spacing Style a Bulleted List. Font Size. Example: h1 { font-size: 16pt; } Or h1 { font-size: 2em; }.

thor
Download Presentation

Changing Text with CSS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Changing Text with CSS

  2. Styling Text • Can emphasize words on a page • Change Font Size • Indent Text • Change the Font • Change Text Alignment • Control Line Spacing • Control Letter Spacing • Style a Bulleted List

  3. Font Size • Example: h1 { font-size: 16pt; } Or h1 { font-size: 2em; } • Accepts a variety of measurement units • Points = pt • Pixels = px • Millimeters = mm • Centimeters = cm • Inches = in • Picas = pc • Em Space = em 1em is equal to the current font size. The default text size in browsers is 16px. So, the default size of 1em is 16px.

  4. Font-Size Example

  5. Indent Text Example p { text-indent: 30px; } • Indents the first line in a paragraph • Gives it a more traditional look and feel • Can use: • mm, cm, in, pt, pc, em

  6. Text-Indent

  7. Change the Font font-family: If Font name is more than one word have to use quotes around it. Can give more than one option in case they don’t have that particular font on their computer separate them with commas. Safe fonts: Arial, Verdana, Courier, Times New Roman

  8. font-family:

  9. Change Text-Alignment Example h1 { text-align: center; } • Can choose: • Left • Right • Center • Justify

  10. Text-align

  11. Control Text Spacing line-height: Adjust the space between lines • letter-spacing: • Adjusts the space between letters

  12. CSS Spacing

  13. Font-Style Make text italic Options: normal - The text is shown normally italic - The text is shown in italics oblique - The text is "leaning" (oblique is very similar to italic, but less supported) p { font-style: italic; }

  14. Font-style

  15. Font-Weight Make text bold Options: • normal • text is displayed normally. This is default • bold • Defines thick characters • bolder • Defines thicker characters • lighter • Defines lighter characters p { font-weight: bold; }

  16. Font-weight

  17. Style a list Unordered List Ordered List • list-style-type: • lower-alpha • lower-roman • upper-alpha • upper-roman • list-style-type: • disc • circle • square • none Can also use an image instead: ul{list-style-image: url('sqpurple.gif');}

  18. List Examples

More Related