Text

Text Properties

PropertyExample values
color#333
text-alignleft, center, right, justify
text-decorationnone, underline, line-through
text-transformuppercase, capitalize
line-height1.6 (unitless is best)
letter-spacing, word-spacing0.05em
text-shadow1px 1px 2px gray
text-overflowellipsis (with overflow:hidden; white-space:nowrap)

Example

Example

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
  <style>
    body { font-family: Arial, sans-serif; }
    .title { text-align: center; text-transform: uppercase; letter-spacing: 0.1em; color: #04AA6D; }
    .body { line-height: 1.7; text-align: justify; }
    a { text-decoration: none; border-bottom: 2px solid #04AA6D; color: inherit; }
    .cut { width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #f1f1f1; }
  </style>
</head>
<body>

<h2 class="title">Text styling</h2>
<p class="body">Line height makes paragraphs easier to read. A value around 1.5 to 1.7 is comfortable for body text. Here is <a href="#">a custom link</a>.</p>
<p class="cut">This long sentence is cut off with an ellipsis at the end.</p>

</body>
</html>

Result