我在Chrome中看到的内容:http://i.imgur.com/shLfA.png
我似乎无法弄清楚输入元素(蓝色字段)周围的间距来自何处.有任何想法吗?
<form method="get">
<fieldset class="halfblock">
<input class="blockheader" type="text" value="Field A">
<textarea class="blocktext" rows="5">Line 1 Line 2</textarea>
</fieldset>
</form>
Run Code Online (Sandbox Code Playgroud)
设置行高:0px;在 .halfblock 上
.quote_body .halfblock {
width: 262px;
border: 1px dotted
#333;
float: left;
margin-bottom: 15px;
line-height: 0px;
}
Run Code Online (Sandbox Code Playgroud)
It's because they are inline elements. Same thing happens often with images.
All you need to do is add display:block to your inputs:
input.blockheader {
margin: 0;
padding: 0;
text-align: center;
background: #ABD9E2;
font: 11px/11px 'Vollkorn', serif;
border: none;
width: 100%;
position: relative;
/* top: -7px; */
display: block;
}
Run Code Online (Sandbox Code Playgroud)