Aligning

An element can be aligned using the left and right properties along with the position property.

 

For instance, set an element's {position:absolute;} then set it's distance from either the left or right edges using values assigned for these properties:

<!DOCTYPE html>
<html>
	<head>
		<title>My Document Title</title>
	</head>
	<body>
		<div style="position:absolute; right:100px; width:300px; border:solid 1px red;">
			<p>But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.</p>
		</div>
	</body>
</html>

Save & refresh browser:

iframe source*

Leave a Reply