我想布局一个文字环绕图片的网页css样式,图片在右下角,不知道怎么写?

我想布局一个文字环绕图片的网页css样式,图片在右下角,不知道怎么写?,第1张

<p>content content content content content content <img src="1jpg" style="float:right;/>content content content content content content content content content content

</p>

在段落中插入img,img设置向右浮动。

是这样 BODY是指页面 那么定义居中是指页面内部元素居中 所以
text_align:center是针对像BODY这样的父元素的(当然指IE都知道)
margin:0 auto是针对父元素内要约束的子元素的(指标准都知道)
所以 你这个要想居中 内部可拟定个子元素 比如BOX吧 然后定义:
body{text-align:center;}
#box{margin:0 auto;}
HTML码:
<body>
<div id="box"></div>
</body>
分就不用了 希望对兄弟有用就好

<div class="body-text">    <div class="img-left">
<img src="img/enyajpg" alt="pic" width="164">
</div>
<div class="word">
<p>LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG TEXT</p>
</div></div>

body-text {    word-wrap: break-word;
}img-left {    width: 164px;
}img-left img {    margin: 0 20px 20px 0;    float: left;
}word {    width: 100%;    text-align: left;

<style>
box{ width:400px;}
ens{word-break:break-all;}
</style>



<div class="box">
<!--为了对比清楚把样式写在标签里了,这个height30px是上方文字空间的高度 -->
<div style="float:right;height:30px;width:1px;"></div>
<!--本例把的大小和容器的大小设为一样了,如果想有间隙调整容器的大小和padding-->
<div style="float:right;width:200px; height:150px;clear:right;">
<img src="imgaes/testjpg" width="200" height="150" />
</div>
<p class="ens"><!--字母这个样式必须加上否则不会自动换行,如果是汉字就不用 -->
ccccccccccccccccccccccccccccc
</p>
</div>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/13322720.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-14
下一篇 2023-07-14

发表评论

登录后才能评论

评论列表(0条)

保存