CSS Property Value How to - text-align: justify;








Question

We would like to know how to text-align: justify;.

Answer


<!DOCTYPE html>
<html lang="en">
<head>
<title>Example of CSS text alignment</title>
<style type="text/css">
h1 {<!-- w  w w .ja  va2  s  .  c  om-->
  text-align: center;
}

p {
  width: 400px;
  text-align: justify;
}
</style>
</head>
<body>
  <h1>Text-align Effect</h1>
  <p>CSS is a Style Sheet Language for formatting the document
    content (written in HTML or other markup language). You might be
    interested by the CSS Working Group wiki too.</p>
</body>
</html>

The code above is rendered as follows: