html - Make div act as a frame -
i've got following html group.
<div id="item-groups"> <!-- section select product types --> <div class="item-group-button"> <!-- item group selection button --> <h3>beverage</h3> </div> <div class="item-group-button"> <!-- item group selection button --> <h3>tobacco</h3> </div> </div>
i've designed following css above elements..
#item-groups{ height: 75px; } .item-group-button{ width:130px; height:40px; float:left; margin:17px 0px 0px 20px; border-radius:10px; background:#4e5154; } .item-group-button h3{ padding:0px; margin:8px 0px 0px 29px; color:white; }
how can design css item-groups div can act frame. explain little bit, item-group-butons loaded db , amount of elements dependent on number of db records. when elements exceed limit, excess elements go out of order. how can stop this? went through method making other elements position absolute needed element can act frame. in case not possible.
i tried removing width limit of item-groups element no use!
update:
as can see first images displayes correctly second images shows more buttons, other elements go out of order. how can fix this. want buttons stick 1 line rather going second line.
when using html frames, when there more elements show, there scroll bar! how can use functionality in div.
it's simple css trick can done bu using following codes.
for parent element :
#item-groups{ height: 80px; width: inherit; overflow-x: scroll; <-- make scrolling horizontal white-space: nowrap; <-- handle white space in element }
for child element :
.item-group-button{ width: 130px; height: 40px; margin: 17px 0px 0px 20px; border-radius: 10px; background: #4e5154; display: inline-block; <-- display excess elements in line }
removing float child element necessary.
thank guys effort!
Comments
Post a Comment