css - How to make right/left icons/text lists in Bootstrap? -
i'm converting old site responsive site using bootstrap, want find general solution converts old layout format uses tables show icons on left , text on right.
so need show texts regardless of length next icons in list this:
but if width gets small, should show this:
the icon can either graphic, font awesome character, or word, , should stay same width.
but right text width should able vary in length , wrap stay left aligned right of icon.
so far, have this:
<div class="row"> <div class="col-xs-1">icon</div> <div class="col-xs-11">this longer text.</div> <div class="clearfix"></div> <div class="col-xs-1">icon</div> <div class="col-xs-11">this longer text.</div> <div class="clearfix"></div> </div>
but on width "lg" breaks up:
and on width "xs" wraps under:
how can make that:
- icon column has constant width
- text column stays right of icon column wraps text according width keeps left margin addition lines
- text column stays left aligned icon column
i recommend bootstrap media object.
.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> <div class="media"> <div class="media-left"> <a href="#"> <img class="media-object" src="https://placehold.it/100x100" alt="..."> </a> </div> <div class="media-body"> <h4 class="media-heading">media heading</h4> here longer text first list item. </div> </div> <div class="media"> <div class="media-left"> <a href="#"> <img class="media-object" src="https://placehold.it/100x100" alt="..."> </a> </div> <div class="media-body"> <h4 class="media-heading">media heading</h4> here longer text first list item. holy moly, long text. keeps going , going. </div> </div>
Comments
Post a Comment