文本环绕图像(或任何元素)

发布于 2024-07-12 13:55:21 字数 207 浏览 5 评论 0原文

有没有办法使用 CSS 将文本包裹在元素(例如图像)的两侧。 我试图将图像放置在段落中间,并希望文本流过它。 请参阅图片示例。 http://i42.tinypic.com/14mvp69.jpg

定位元素通常会将其带出文档流; 所以那是行不通的。

Is there a way with CSS to wrap text on both sides of an element (an image for example). I am trying to have an image positioned in the middle of a paragraph and would like text to flow over it. Please see the image for an example.
http://i42.tinypic.com/14mvp69.jpg

Positioning an element typically takes it out of the document flow; so that doesn't work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

乜一 2024-07-19 13:55:21

我不这么认为,不。 必须使用多个文本列。

我只是整理了一种可能的解决方案。 您可以通过 http://www.sampsonresume.com/labs/img- 访问它中间/

I don't think so, no. Not without working with multiple text-columns.

I just threw together one possible solution. You can access it at http://www.sampsonresume.com/labs/img-in-middle/

乖乖公主 2024-07-19 13:55:21

我见过的唯一与此类似的东西是 A List Apart 文章: Cross-Column Pull-Out第二部分:自定义剪影。 您仍然需要多个文本列,甚至 ALA 将其列为“实验性”。 不过,这可能值得一看。

示例

The only thing that I have seen similar to this would be the A List Apart article: Cross-Column Pull-Out Part Two: Custom Silhouettes. You still need multiple text columns, and even ALA lists it as "experimental". It may be worth checking out, though.

Example here.

仅此而已 2024-07-19 13:55:21

并非没有一些非常棘手/乏味的文本解析。 但是,如果您让尝试阅读该文本的人每行在图像上来回跳转两次,他们会讨厌您,所以这可能是一件好事。

Not without some very tricky/tedious text parsing. But anyone trying to read that text would hate you if you made them jump back and forth across an image twice per line, so that's probably a good thing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文