form > div {
clear: both;
overflow: hidden;
padding: 1px;
margin: 0 0 0 0;
}
form > div > div {
margin: 0 0 0 0;
}
form > div > label {
width: 25%;
float: left;
padding-right: 10px;
}
form > div > div {
width: 75%;
float: right;
}
form > div > label {
font-size: 90%;
}
input[type=text],
input[type=email],
input[type=url],
input[type=tel],
input[type=password],
textarea {
width: 60%;
}
input[type=text],
input[type=email],
input[type=url],
input[type=tel],
input[type=password],
textarea,
select {
height:35px;
padding:5px;
color:#F36F25;
font-size:16px;
border: 1px solid #F36F25;
}
input[type=text]:focus,
input[type=email]:focus,
input[type=url]:focus,
input[type=password]:focus,
textarea:focus {
outline: 0;
border-color: #F36F25;
font-weight:bold;
}
@media (max-width: 600px) {
form > div {
margin: 0 0 15px 0;
}
form > div > label {
width: 100%;
float: none;
margin: 0 0 5px 0;
}
form > div > div {
width: 100%;
float: none;
}
input[type=text],
input[type=email],
input[type=url],
input[type=password],
textarea,
select {
width: 100%;
}
}
@media (min-width: 1200px) {
form > div > label {
text-align: right;
}
}
使用標籤來創建一個負責任的HTML表單,它的工作不錯,但林不知道如何使標籤和水平,內聯形成元素表單元素似乎顯示比標籤
謝謝你 - 偉大工程。我在這裏更新了它 - http://jsfiddle.net/17h5da97/8/ - 我如何使標籤在中間垂直顯示? – user2710234 2014-12-04 11:39:27
在更新的例子中它們不在中間嗎? http://jsfiddle.net/17h5da97/6/ – Morpheus 2014-12-04 11:46:58
是的 - 我增加了一個高度進入形式> div>標籤導致的問題。謝謝!:) – user2710234 2014-12-04 11:52:24