html - How to prevent CSS block elements from affecting parent inline-blocks -
html - How to prevent CSS block elements from affecting parent inline-blocks -
i having issue elements within inline-block parent. kid elements of 1 affecting other. tough explain easy see in fiddle, div on right beingness pushed down.
i have tried various things, sure there simple solution. advice appreciated.
http://jsfiddle.net/62asy/
html:
<div id="schedule"> <div class="schedulechoice">leagues <select name="leaguelist" id="leaguelist" class="schedulechoicelist"> <option value="0">select league</option> <option value="leagueid_246"> aassss</option> <option value="leagueid_245"> aaa</option> </select> <select name="teamlist" id="teamlist" class="schedulechoicelist"> </select> <div class="schedulechoicesubmit">submit</div> </div> <div class="schedulechoice">arena <select name="arenalist" id="arenalist" class="schedulechoicelist"> <option value="0">select arena</option> <option value="arenaid_2"> ffffff</option> <option value="arenaid_1"> ffffff</option> </select> <div class="schedulechoicesubmit">submit</div> </div> </div> css:
#schedule { background-color: rgba(0, 0, 0, 0.44); overflow: hidden; text-align: center; } .schedulechoice { display: inline-block; width: 25%; background-color: rgba(190, 216, 255, 0.54); height: 200px; padding: 5px; border-radius: 5px; margin: 20px 25px; } .schedulechoicelist { width: 200px; padding: 5px; border-radius: 4px; display: block; margin: 10px auto; }
add vertical align top
.schedulechoice { vertical-align: top; } edited fiddle
http://jsfiddle.net/62asy/1/
html css
Comments
Post a Comment