我有一組按鈕,在HTML:縮水減少頁面的CSS時設置按鈕 - HTML
<div class="controls">
<div id="s-controls">
<button class="control-btn" style="background-color: #2de7f6">1</button>
<button class="control-btn" style="background-color: #69a6ea">2</button>
<button class="control-btn" style="background-color: #736ace">3</button>
<button class="control-btn" style="background-color: #372ac3">4</button>
</div>
</div>
,我想盡量減少頁面時收縮。現在這樣做時,按鈕保持其大小,設計看起來很混亂。
我已經嘗試了很多與CSS的東西,但我不是很擅長它。這是我到目前爲止:
.controls {
background-color: #1F1F1F;
min-height: 50px;
}
button {
margin: 20px auto;
max-width: 100%;
}
#s-controls, #p-controls {
text-align: center;
}
#s-controls > *, #p-controls > * {
font-family: "Titillium Web", sans-serif;
font-weight: 600;
color: white;
cursor: pointer;
}
.control-btn {
display: inline-block;
/*border-radius: 4px;*/
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
line-height: 2.5em;
padding: 0 3em;
text-decoration: none;
}
line-height: 1.75em;
padding: 0 0.75em;
}
.control-btn:hover {
box-shadow: inset 0 1px 1px rgba(255,255,255,0.5),
inset 0 1.5em 1em rgba(255,255,255,0.3);
}
我打算在純html和css中做到這一點。這個想法是在某些時候縮小按鈕,以保持最初的一排設計。
任何幫助將升值!
嘗試使用百分比按鈕的寬度和高度。例如'width:50%'另外,[Materialize](http://materializecss.com/)CSS框架可能會讓您的靜態網頁設計更容易。檢查出來。 –
「最小化頁面」是什麼意思? – Rokin
@AkshayDamle我試圖解決沒有框架的東西,所以我可以學習基礎知識。但是,當你調整瀏覽器頁面的大小時,這會讓我瘋狂 – Limon