css - How to set an auto width to a div that is a background for a button -
i attempting put div around buttons in app. divs should have 5px padding around button. however, div keeps spanning entire width of page unless set width number. easier have 'auto' width every div instead of specifying width each individual button. there way this?
stylesheet:
.button_div {width: auto; height: auto; border-radius: 10px; padding: 5px;}
view:
<div class="button_div">
thanks!
the 'auto' width div is div take full width. div's block-level default.
to div collapse down size of contents, need either float it, or set display inline-block.
Comments
Post a Comment