0
我在使用css格式時遇到了一些麻煩。我希望h2能夠集中在一條線上,但由於某種原因,它並沒有這樣做。我已經檢查了顯而易見的地方,例如display屬性,但沒有找到任何東西。在應用我的css之前,我使用了normalize.css。 從index.html的爲什麼我的h2不能停留在一條線上?
<div class = "input-area">
<div class = "input-wrapper">
<h2>Pick <a href="http://en.wikipedia.org/wiki/Three">three</a> powers!</h2>
</div>
<div class = "options">
<div class = "input-list first-list">
<ul>
<li><button type = "button" id = "choice 1"> </button></li>
<li><button type = "button" id = "choice 2"> </button></li>
<li><button type = "button" id = "choice 3"> </button></li>
<li><button type = "button" id = "choice 4"> </button></li>
<li><button type = "button" id = "choice 5"> </button></li>
</ul>
</div>
<div class = "input-list">
<ul>
<li><button type = "button" id = "choice 6"> </button></li>
<li><button type = "button" id = "choice 7"> </button></li>
<li><button type = "button" id = "choice 8"> </button></li>
<li><button type = "button" id = "choice 9"> </button></li>
<li><button type = "button" id = "choice 10"> </button></li>
</ul>
</div>
</div>
<div class = "input-wrapper">
<button type="button" onclick = "test()" id = "submit" >Test</button>
</div>
</div>
從style.css的
/*input */
.input-area
{
margin:0;
padding:0;
background: #2dcc70;
}
.input-wrapper
{
margin: 0px 50%;
clear:both;
}
.options
{
width: 100%;
margin: 5px 0 5px 0;
}
.input-list
{
display:inline;
list-style: none;
float:left;
margin: 0 3% 0 3%;
}
我試着顯示屬性的幾個選項,但我所有的想法......也開放給一些批評
謝謝!還在學習,這只是我的做法。採取你的意見與包裝的矯枉過正以及 – user3784927