Вертикальное выравнивание: свойство vertical-align

Вертикальное выравнивание с помощью CSS: свойство vertical-align.

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>vertical-align</title>
	<style>
		p {
			font: 1em arial, helvetica, sans-serif;
			width: 780px;
		}
		#va {
			font-size: 40px;
		}
		#zero {
			font-size: 0.5em;
			vertical-align: text-top;
		}
		#one {
			font-size: 0.5em;
			vertical-align: top;
		}
		#two {
			vertical-align: -0.5em;
		}
		#three {
			font-size: 0.5em;
			vertical-align: middle;
		}
		#four {
			font-size: 0.5em;
			vertical-align: sub;
		}
		#five {
			font-size: 1.5em;
			vertical-align: 0.5em;
		}
		#six {
			font-size: 0.5em;
			vertical-align: super;
		}
		#seven {
			color: #0a0;
			vertical-align: super;
		}
	</style>
</head>
<body>
	<p id="va"><span id="zero">A</span> daft <span id="one">example</span> to <span id="two">show</span> what <span id="three">can</span> be <span id="four">achieved</span> with the <code id="five">vertical-align</code> CSS <span id="six">property</span>.</p>
	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in <span id="seven">Boo!</span> voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</body>
</html>

 

Страницы в тему:

Добавить комментарий