css - Aligning paragraphs and sub-paragraphs horizontally -
is there way present data follows using css?
an article divided paragraphs, , each paragraph has (usually smaller) box/sub-paragraph right of it, horizontally aligned respective paragraph.
yes, possible. here example of how can achieve http://jsfiddle.net/sptzh/1/ html:
<section class="content"> <article class="row"> <p>paragraph a</p> <div class="teaser"> text related text related text related text related text related text related </div> </article> <article class="row"> <p>paragraph b paragraph b paragraph b paragraph b</p> <div class="teaser"> text related b </div> </article> </section>
css:
.content { width: 500px; } .row { clear: both; padding: 10px; border-top: solid 1px #000; } .row:after { content: ""; display: table; clear: both; } .row p { width: 60%; float: left; box-sizing: border-box; -moz-box-sizing: border-box; padding: 0; margin: 0; font-size: 50px; } .row .teaser { width: 40%; float: left; box-sizing: border-box; -moz-box-sizing: border-box; padding: 6px; border: dotted 1px #999; }
Comments
Post a Comment