gpt4 book ai didi

javascript - 将元素放置在特定的 px 处,但让文本围绕它流动

转载 作者:行者123 更新时间:2023-11-28 16:47:57 30 4
gpt4 key购买 nike

我能否在页面上的特定 px 位置放置一个元素(例如图像),然后让文本围绕它流动?

必要时使用 JS/jquery。

我确实看到了这个Have text flow around an object that can be moved by the user .它没有答案,但它已经有几年历史了……

编辑:假设页面上全是文本,那么更改图像的位置不应改变文本的开始和结束位置,而应该围绕图像的新位置流动。

最佳答案

希望对您有所帮助。

HTML

<div class="container">
<img class="image" src="http://indianapublicmedia.org/stateimpact/files/2013/01/apple-image-300x300.jpg" alt="Apple" />

<p class="text">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>

</div>

CSS

.container
{
position:absolute;
top:200px;
left:200px;
width:480px;
}

.image
{
float:left;
margin:10px;
}

link

关于javascript - 将元素放置在特定的 px 处,但让文本围绕它流动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32940802/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com