我想将图像与段落的右侧对齐,并且我希望能够这样做,而不必在段落上设置固定宽度以及远离图像的一些填充。我怎样才能做到这一点?
https://jsfiddle.net/mnakoajk/ https://jsfiddle.net/mnakoajk/
* {
box-sizing: border-box;
}
p {
float: left;
border: solid 1px #000;
display: inline-block;
}
img {
float: right;
display: inline-block;
}
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
<img src="https://media.tenor.co/images/fe795771396053d4e1d55904dcf20298/tenor.gif" />
Place <img>
inside <p>
.
<p>
<img src="https://media.tenor.co/images/fe795771396053d4e1d55904dcf20298/tenor.gif" />
is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
</p>
https://jsfiddle.net/uew5yw2/ https://jsfiddle.net/uvew5yw2/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)