# Set Text Alignment using CSS

CSSWeb DevelopmentFront End Technology

To set text alignment using CSS, use the text-align property. Following are the possible property values −

text-align: left|right|center|justify|initial|inherit;

## Example

Let us see an example to set text alignment −

Live Demo

<!DOCTYPE html>
<html>
<style>
.demo {
-webkit-columns: auto auto; /* Chrome, Safari, Opera */
-moz-columns: auto auto; /* Firefox */
columns: auto auto;
text-align: justify;
}
</style>
<body>
<h1>Machine Learning</h1>
<div class="demo">
Today’s Artificial Intelligence (AI) has far surpassed the hype of blockchain and quantum computing. This is due to the fact that huge computing resources are easily available to the common man. The developers now take advantage of this in creating new Machine Learning models and to re-train the existing models for better performance and results. The easy availability of High Performance Computing (HPC) has resulted in a sudden increased demand for IT professionals having Machine Learning skills.
</div>
</body>
</html>

## Example

Let us now see another example −

Live Demo

<!DOCTYPE html>
<html>
<style>
body {
}
.demo {
text-decoration: overline;
text-decoration-color: yellow;
font-variant:normal;
text-align: center;
}
</style>
</html>