html - How to position the check box inside li element to center? -
i have list of items div
content , span check box. want position check box span center of li
element.
<li class="e-list e-state-default e-list-check"> <div class="cont-bg"> content here varies </div> <span > <input class="e-lv-check e-checkbox e-js e-input" type="checkbox"/> </span> </li>
content loaded dynamically height , width varies. couldn't set padding positioning. tried on positioning using vertical-align well. nothing worked.
.e-list.e-state-default { background-color: #fff; border-color: #c8c8c8; } .e-list { border-bottom: 1px solid #c8c8c8; font-size: 12px; } .cont-bg { font-size: 17px; height: 100px; padding-left: 5px; padding-top: 10px; width: 80%; display: inline-block; } .e-list .e-lv-checkdiv { float: right; } .e-list { border-bottom: 1px solid #c8c8c8; font-size: 12px; } .e-list { line-height: normal; padding: 0 15px; cursor: pointer; vertical-align: middle; }
<ul> <li class="e-list e-state-default e-list-check"> <div class="cont-bg"> <div class="brooke"> </div> <div class="listrightdiv"> <span class="templatetext">brooke</span> <span class="designationstyle">hr assistant</span> <div class="aboutstyle"> brooke provides administrative support hr office. brooke provides administrative support hr office. brooke provides administrative support hr office. </div> </div> </div> <span><input class="e-lv-check e-checkbox e-js e-input" type="checkbox" tabindex="" name="null" value="true" /> </span> </li> <li class="e-list e-state-default e-list-check"> <div class="cont-bg"> <div class="brooke"> </div> <div class="listrightdiv"> <span class="templatetext">brooke</span> <span class="designationstyle">hr assistant</span> <div class="aboutstyle"> brooke provides administrative support hr office. brooke provides administrative support hr office. brooke provides administrative support hr office. </div> </div> </div> <span><input class="e-lv-check e-checkbox e-js e-input" type="checkbox" tabindex="" name="null" value="true" /> </span> </li> </ul>
can 1 me?
why mixing <div>
, <span>
? having both in span give right results right? can use this:
.e-list, .e-list span {vertical-align: middle; text-align: center;}
<li class="e-list e-state-default e-list-check"> <span class="cont-bg"> content here varies </span> <span> <input class="e-lv-check e-checkbox e-js e-input" type="checkbox"/> centered. </span> </li>
if reason, cannot change <div>
<span>
, use:
.e-list {vertical-align: middle; text-align: center;} .e-list div, .e-list span {vertical-align: middle; text-align: center; display: inline-block;}
<li class="e-list e-state-default e-list-check"> <div class="cont-bg"> content here varies </div> <span> <input class="e-lv-check e-checkbox e-js e-input" type="checkbox"/> centered. </span> </li>
Comments
Post a Comment