<html>
<head>
<style>
body {
margin: 0;
padding: 0;
}
.container {
position: relative;
width: 100%;
}
.right {
position: absolute;
right: 0px;
width: 300px;
background-color: #b0e0e6;
}
</style>
</head>
<body>
<h1>右对齐</h1>
<div class="container">
<div class="right">
<p><b>注释:</b>如果使用 position 属性实现对齐,请始终包含 !DOCTYPE 声明!如果省略,IE 浏览器会产生奇怪的结果。</p>
</div>
</div>
</body>
</html>