html - How to align the first line of a paragraph center to an image. And the other lines and the first line are the same indentation? -
i have image , paragraph. want 'css' image on left , paragraph on right. , first line of paragraph has display center image. , other lines have indent same first line.
can css that? hope can teach me way achieve that.
thank in advanced!
html:
<div class="parent"> <img src="http://jsfiddle.net/img/logo.png"> <div class="child"> bottom of element aligned bottom of parent element's font. bottom of element aligned bottom of parent element's font. bottom of element aligned bottom of parent element's font. </div> </div>
css:
img { display: inline; } .child { display: inline; }
here jsfiddle: https://jsfiddle.net/qn4bh8ht/
don't work @ all. :(
try these: jsfidle.
i use display: table
.parent
class table-cell
children + vertical-align: top
on .child
class.
.parent { display: table; } .parent > * { display: table-cell; } .child { vertical-align: top; }
Comments
Post a Comment