CSS Layout - 如何內(nèi)聯(lián)元素的垂直對齊
我們想知道如何內(nèi)聯(lián)元素的垂直對齊。
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.login-button {
background-color: lightgray;
padding: 5px;
}
.loadingImg {
padding: 0 20px;
margin: 0 20px;
background-color: white;
vertical-align: middle;
}
.loginSubmit {
vertical-align: middle;
}
.error {
color: red;
font-weight: bold;
vertical-align: middle;
}
</style>
</head>
<body>
<p class="login-button">
<input class="loginSubmit" type="submit" value="Log On" />
<img class="loadingImg" src="http://placehold.it/20x20"
height="40" width="40" />
<span class="error">text</span>
</p>
</body>
</html>