Welcome to Code Sharer, a code gallery for creating, saving and sharing all kinds of code snippets.

CSS — Text Alignment

Posted On: Wednesday, October 29, 2014 at 8:04 PM

This snippet will align any entered text
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-align: center;
}

p.date {
text-align: right;
}

p.main {
text-align: justify;
}
</style>
</head>
<body>

<h1>CSS text-align Example</h1>
<p class="date">May, 2009</p>
<p class="main">This will basically serve as empty lines to show that text alignment works with this snippet of code.This will basically serve as empty lines to show that text alignment works with this snippet of code.This will basically serve as empty lines to show that text alignment works with this snippet of code. .'</p>
<p><b>Note:</b> Resize the browser window to see how the value "justify" works.</p>

</body>
</html>

Joined on Wednesday, October 29, 2014
Contributed 2 Snips

Get Social and Share

Tags