我有一個以頁面爲中心的表單,並且元素在窗體中居中。但是,我希望文本在我的表單中與輸入框的左邊緣對齊。換句話說,我希望文本的第一個字母從輸入框的左邊開始。請參見下面的代碼和圖像:如何修復文本到居中文本框css的左邊緣
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Log In</title>
</head>
<style type="text/css">
#wrapper{
border:1px solid black;
max-width:200px;
max-height:200px;
display-webkit-box;
margin-left:auto;
margin-right:auto;
padding:5px;
border-radius:5px;
}
#login input{
display:-webkit-box;
margin-left:auto;
margin-right:auto;
}
#login span{
}
</style>
<body>
<div id="wrapper">
<form id="login" action="#" method="POST">
<span>User Names:</span><br>
<input type="text"><br>
<span>Password:</span><br>
<input type="password"><br>
<input type="submit" value="Log In">
</form>
</div>
</body>
</html>
text.align:左.. – scaisEdge
可能重複的[CSS:左,中心和右對齊同一行上的文本](http://stackoverflow.com/questions/13694062/css-left-center-right-align同上) –