html是div环绕文字,如何在右下角的div上环绕文字?

每次我尝试在CSS中执行看似简单的操作时,它都不起作用。

我有一个包含460x160图片的内容div。我要做的就是将图像放置在右下角,然后将文字环绕起来。

...

text text text text text text ...

所以我希望它看起来像:

------------------

| text text text |

| text text text |

| text text -----|

| text text | |

------------------

用左上或右上的图像来做是蛋糕:

#contents img { float:right; }

------------------

| text text | |

| text text -----|

| text text text |

| text text text |

------------------

现在我如何将其推到最低点?到目前为止,我想出的最好的方法是:

#contents img { float:right; margin-top: 90%} // really needs to be 100%-160px

------------------

| text text |

| text text |

| text text -----|

| text text | |

------------------

在这种情况下,文本不会在空白处打印,因此图像上方有空白。

#contents { position:relative; }

#contents img { position:absolute; right:0; bottom:0; }

-or-

// move the img tag under the text in the html and:

#contents img { float:right; margin-top:-160; }

------------------

| text text text |

| text text text |

| text text -----|

| text text | te |

------------------

在这种情况下,文本将打印在图像上方或下方。

那么…我该怎么做呢?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值