CSS Align

by Abhishek 02-Jul-16

0 762


CSS Align: The CSS (Cascading Style Sheet) property describes how inline content like text is aligned in its parent block element.

Example:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
.center{
margin: auto;
width: 50%;
border: 1px solid #ddd;
padding: 25px;
}
.position {
position: absolute;
left:0px;
width: 20%;
border: 1px solid #eee;
padding: 25px;
}
</style>
</head>
<body>

<h2> CSS Align </h2>
<h3> Center Align </h3>

<div class="center">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sagittis, justo eu maximus tempor, ante ex scelerisque sem, vel auctor velit justo et nisl. Donec laoreet condimentum lorem nec facilisis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sagittis, justo eu maximus tempor, ante ex scelerisque sem, vel auctor velit justo et nisl.
</div>
<h3> Center align </h3>
<div class="position">

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sagittis, justo eu maximus tempor, ante ex scelerisque sem, vel auctor velit justo et nisl. Donec laoreet condimentum lorem nec facilisis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sagittis, justo eu maximus tempor, ante ex scelerisque sem, vel auctor velit justo et nisl.

</div>
</body>
</html>


Share:


Comments

    No Comments Yet.

Leave a Reply