なぜ選択要素の幅が入力要素の幅よりも短いのか分かりません。両方を100%に設定していますが、入力何らかの理由でグリッド境界をオーバーレイします。入力要素の幅が選択要素の幅よりも短い
HTML:
<div class="gridView">
<input type="text" placeholder="Name" />
<input type="text" placeholder="Last Name" />
<select></select>
<input type="text" placeholder="Birth Date" />
<select> </select>
<select> </select>
<input type="text" placeholder="Passport Number" />
<span>
<input placeholder="Passport Expiry Date"/>
<span class="dateFormat">YYYY-MM-DD</span>
</span>
</div>
CSS:
input {
width: 100%;
padding: 6px;
height: 25px;
}
select {
height: 41px;
width:100%;
}
.gridView {
display: grid;
grid-template-columns: 1fr 1fr;
grid-column-gap: 25px;
grid-row-gap: 10px;
font-family: sans-serif;
margin: auto;
width: 50%;
}
.dateFormat {
color: red;
font-size: small;
display: block;
margin-left: 15px;
margin-bottom: 5px;
font-weight: bold;
}
JSFIDDLE
https://jsfiddle.net/AlexLavriv/oxmq71sn/1/
あなたのフィドルはここのソースと同じではありません。 'select'幅は設定しません。 –
追加:* {余白:0;パディング:0;ボックスサイズ:border-box} – VXp