html - 将文本环绕在一个 div 周围

标签 html css text

如何让 div 2 环绕 div 1 ?

(两个 div 都包含文本)

+---++------------------+
|   ||                  |
| 1 ||                  |
|   ||          2       |
+---+|                  |
+----                   |
|                       |
+-----------------------

最佳答案

float 1:Demo

CSS:

#d1 {
  float: left;
}

HTML:

<div id="d1">Hello world. Hello world. Hello world. </div>
<div id="d2">
  Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing. Testing.
</div>

关于html - 将文本环绕在一个 div 周围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14116266/

相关文章:

text - 在 AutoHotkey 中快速发送长文本

css - GridView 重写 GridView CssClass 的中心列

java - 选择 Graphics/Graphics2D 中的文本

javascript - 我正在尝试使用带有 html 和 js 的不同按钮在同一变量上传递不同的链接

javascript - 使用带有 onclick 的目标 ="_blank"时新窗口未打开

javascript - 如何轻松地将自定义字体放入 HTML5 Canvas 中?

javascript - GetElementById 在 Chrome 中给出 ReferenceError

html - ASP :Menu children stays visible

html - Bootstrap 在导航菜单中自动向左浮动

html - 如何布局图像,使其位于广告空间的左侧,但使用 flexbox 居中