html - Why I can't align two buttons -
i have problem, can't align 2 buttons in 1 line.
i tried set padding of span class pptext2 without success. here code http://jsfiddle.net/71782p4l/1/
html
<div class="ppdiv"> <button class="ppenvelope"><img src="http://i.imgur.com/rflmyak.jpg" alt="slika"></button><button class="pptext"><span class="pptext2">private message</span></button> </div><!--zatvoren ppdiv-->
css
.ppdiv{ padding-top:22px; padding-left: 19px; } .ppdiv img{ padding:10px; font-size: 20px; } .ppenvelope{ border:none; border-top-left-radius: 4px; border-bottom-left-radius: 4px; background: #b2d4dd; } .pptext{ border:none; border-top-right-radius: 4px; border-bottom-right-radius: 4px; background: #c9e0e6; } .pptext2{ display: inline-block; color:#4c6974; padding-top: 15px; padding-bottom:13px; padding-left: 13px; }
i set float: left;
on both buttons , overflow: hidden;
on .ppdiv
. make sure both buttons stay same height, set height
on them (e.g. height: 48px;
). can remove span.pptext2
element altogether, unless need other purposes. take @ fiddle: https://jsfiddle.net/igi33/ck4w6clq/1/.
html:
<div class="ppdiv"> <button class="ppenvelope"> <img src="http://i.imgur.com/rflmyak.jpg" alt="slika"> </button> <button class="pptext">private message</button> </div>
css:
.ppdiv{ overflow: hidden; } .ppenvelope, .pptext { float: left; border: none; height: 48px; } .ppenvelope{ border-top-left-radius: 4px; border-bottom-left-radius: 4px; background: #b2d4dd; } .ppdiv img{ padding:10px; } .pptext{ border-top-right-radius: 4px; border-bottom-right-radius: 4px; background: #c9e0e6; color:#4c6974; }
Comments
Post a Comment