我可以将元素(例如图像)放置在页面上的特定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/

10-12 20:49