オリジナルのブートストラップのbtn-group-justified
をラジオinput
フィールド(http://getbootstrap.com/javascript/#buttons-examples)でスタイルしたいと思います。スタイリングブートストラップのbtn-group-justified、マージンとサイジングを垂直方向に追加する
オリジナルのスタイルは、次のようになります。
が、私はすべてのボタン正方形のボタンを作成し、それらを相互間のすべてのいくつかの空白を与えたいと思います。このような何か:
私はブートストラップ例
[data-toggle="buttons"] .btn>input[type="radio"] {
display: none;
}
.category-select .btn-container {
position: relative;
width: 19%;
padding-bottom: 19%;
float: left;
height: 0;
margin: 1%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.btn-container .btn,
.btn-container .btn input {
max-width: 100%;
}
<div class="btn-group-justified category-select" data-toggle="buttons">
<div class="btn-container">
<label class="btn category category-one">
<input type="radio" name="options" id="option1"> One
</label>
</div>
<div class="btn-container">
<label class="btn category category-two">
<input type="radio" name="options" id="option2"> Two
</label>
</div>
<div class="btn-container">
<label class="btn category category-three">
<input type="radio" name="options" id="option3"> Three
</label>
</div>
<div class="btn-container">
<label class="btn category category-four">
<input type="radio" name="options" id="option4"> Four
</label>
</div>
<div class="btn-container">
<label class="btn category category-five">
<input type="radio" name="options" id="option5"> Five
</label>
</div>
</div>
が、私が望むようもちろん、このCSSは私のボタンのスタイルを設定しませんから少し修正HTMLマークアップをしようとしていました...私が達成したい
機能は、5つのボタンを持って水平に正当化し、応答(すべてのブラウザのサイズで正方形)とラジオボタンのグループのように行動することです。
「意図したとおりに」動作しないとはどういう意味ですか?あなたが適用するスタイルは良く見えなかったのですか、あるいはブートストラップスタイルを正しく上書きしていませんでしたか?あなたはブートストラップスタイルを上書きしてあなたの写真のように見える正しいCSSが必要ですか? – DigTheDoug
私のスタイルはブートストラップのデフォルトを上書きしましたが、うまく見えません:)ラジオボタンを四角いマージンで表示するよう修正されたCSSが必要です...今はBass Jobsenのソリューションを試してみます... – errata