我正在嘗試使用四個和八個按鈕進行多項選擇測驗。我遇到的問題是讓他們分成兩列。我試過使用「列:2」,但他們變得不均勻,我試圖改變列表的寬度,以強制他們,但這並沒有爲我工作。將CSS按鈕分成兩列
這裏有一個的jsfiddle:https://jsfiddle.net/sethkillian2/2t63v2nz/3/
<div id="central-area" class="central-area">
<div class="main multiple-choice">
<div class="question-row row column">
<div class="question-text">
vivre
</div>
</div>
<div class="hint row column">
<span class="hint-text">Select the correct <strong>French</strong> for the <strong>English</strong> above:</span>
</div>
<ol class="choices clearfix ">
<li class="shiny-box choice clearfix" data-choice-id="0">
<span class="val ">to return</span>
<span class="marking-icon"></span>
</li>
<li class="shiny-box choice clearfix" data-choice-id="1">
<span class="val ">to wear</span>
<span class="marking-icon"></span>
</li>
<li class="shiny-box choice clearfix" data-choice-id="2">
<span class="val ">to sustain</span>
<span class="marking-icon"></span>
</li>
<li class="shiny-box choice clearfix" data-choice-id="3">
<span class="val ">to live</span>
<span class="marking-icon"></span>
</li>
</ol>
</div>
</div>
CSS代碼:
.multiple-choice .hint {
text-shadow: 1px 1px 0 white;
color: #aaa;
font-family: "Helvetica Neue", "Helvetica", "Arial", "Kai", "KaiTi", Sans-Serif;
padding: 11.42857px;
font-size: 17.6px;
}
.multiple-choice .hint .hint-text {
display: block;
float: left;
overflow: hidden
}
.multiple-choice ol {
display: block;
list-style-type: none;
padding: 0;=
}
.multiple-choice li {
width: 260px;
margin-top: 12px;
padding: 8px 17px 8px 43px;
overflow: hidden;
}
.multiple-choice li:hover {
background-color: purple;
color: white;
}
.shiny-box {
color: #6D6E70;
border: 1px solid #e6e6e6;
background-color: #fff;
border-radius: 10px;
background-repeat: repeat-x;
background-size: 100% 100%;
border: 1px solid #E6E6E6;
color: #3E3E3E;
font-family: "Times New Roman", "Times", "Kai", "KaiTi", Serif;
font-size: 30px;
line-height: 41px;
transition: background-color 0.1s linear, opacity 0.1s linear, border-color 0.1s linear
}
而這裏的想什麼,我VS我有一個圖片。
是[THIS](https://jsfiddle.net/bonez0607/0vtjetzf/1/)你在找什麼? –
是的!絕對。 –
好我已經添加它作爲答案。 –