作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要强制左侧 div 的内容在找到它时在右侧流动。
.class1 {
background-color: #678e6f;
width: 80%;
float: left;
}
.class2 {
background-color: #00ff34;
width: 300px;
float: right;
}
<div class="class">
<div class="class1">
<img/><img/><img/>
</div>
<div class="class2">
<li>text</li>
</div>
</div>
但是当 div 发生碰撞时完全可以容忍
我需要这样的东西来传输所有元素。 http://htmlbook.ru/example/
有没有可能做这样的事情?
最佳答案
你的例子有很多问题,但如果你想让文本围绕右侧的图像(或任何 div)流动,它看起来或多或少像这样:
.classContainer {
background-color: #678e6f;
}
.classFloat {
background-color: #00ff34;
width: 300px;
float: right;
margins: 10px; /* you probably want margins! */
}
然后是 HTML:
<div class="classContainer">
<div class="classFloat">
<img /> <!-- here is an image the text would flow around. -->
</div>
<p>Here is the material that will flow around the floating div.</p>
</div>
当然,文本和图像哪个并不重要;或者它们都可以是文本或都是图像。内容无关紧要。但是围绕文本流动的图像是不寻常的!
关于html - 如何使左侧div的内容与右侧div相撞?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53419188/
我想改善碰撞系统。 现在,我检测2个不规则对象的边界矩形是否碰撞。 我想获得for矩形的相应椭圆,而另一个则使用圆形。我找到了一种获取椭圆坐标的方法,但是当我尝试检测椭圆是否与圆相交时遇到了问题。 您
我想在 GWT 中为我的 FlexTable 定义一组 CSS 规则。我为奇数和偶数的所有组合定义了 4 种不同的规则。 .myTable tbody tr:nth-child\(odd\) td:n
我是一名优秀的程序员,十分优秀!