이 이미지에 표시된 것과 같은 레이아웃을 내 양식에 제공하려합니다. http://reversl.net/demo/ 이름 및 성 입력은 인라인이지만 다른 모든 입력은 스택으로 (즉, 서로 위에) 쌓여 있습니다. 현재 다음과 같은 마크 업을 사용하는 http://reversl.net/form/과 같은 것을 가지고 있습니다.인라인 및 블록 입력 입력
<div class="container">
<form>
<ol>
<li>
<label for=name>Firstname:</label>
<input id=name name=name type=text placeholder="Jon" required autofocus>
</li>
<li>
<label for=name>Surname:</label>
<input id=surname name=surname type=text placeholder="Doe" required autofocus>
</li>
<li>
<label for=message>Message:</label>
<textarea id=message name=message placeholder="Type your message here..." required></textarea>
</li>
</ol>
</form>
</div>
다음과 같이 스타일이 지정됩니다.
label {
display: block;
line-height: 1.75em;
}
input, textarea {
width: 250px;
display: inline-block;
margin-bottom: 2em;
padding: .75em .5em;
color: #999;
border: 1px solid #e9e9e9;
outline: none;
}
input:focus, textarea:focus {
-moz-box-shadow: inset 0 0 3px #aaa;
-webkit-box-shadow: inset 0 0 3px #aaa;
box-shadow: inset 0 0 3px #aaa;
}
textarea {
height: 100px;
}
하게? – Ktash
@ktash, 알았어요. 선택한 li을 표시하도록 설정해야합니다. 인라인 블록 – Jedda