如何将文本从DIV流到DIV? [英] How to flow text from DIV to DIV?

查看:108
本文介绍了如何将文本从DIV流到DIV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个 DIV ,在 HTML 页面的两边有绝对位置,例如(示例

I have two DIVs with absolute position on two sides of a HTML page such as (EXAMPLE)

<div class="left">
</div>
<div class="right">
</div>

使用CSS

.left{
    position:absolute;
    left:10px;
    top:10px;
    width:100px;
    height:100px;
    background:red;
}
.right{
    position:absolute;
    right:10px;
    top:10px;
    width:100px;
    height:100px;
    background:blue;
}



< DIV 并将多余的文本流向右边?我不会坚持这两个 DIV ,我只是寻找一个解决方案,将多余的文本流到另一个位置。

Is there a way to add text to the left DIV and flow excess text to the right one? I am not stuck to this two DIV, and I'm just looking for a solution to flow excess text to another position.

注意:我希望找到一个纯粹的 CSS 解决方案,但似乎不太可能;然后,我正在寻找一个纯javascript 解决方案(不使用JS库)。

NOTE: I hope to find a pure CSS solution, though, it seems to be improbable; then, I am looking for a pure javascript solution (not using JS libraries).

推荐答案

CSS地区(仍然是草稿,但是)旨在解决这个问题:

CSS Regions (still a 'draft', but) is aiming to fix this problem:


模块允许内容跨多个区域流动
称为区域。区域在
文档顺序中不一定是连续的。 CSS区域模块提供了高级内容
流程机制,其可以与定位方案组合为由其他CSS模块定义的
,例如多列模块[CSS3COL]
或网格布局

The CSS regions module allows content to flow across multiple areas called regions. The regions are not necessarily contiguous in the document order. The CSS regions module provides an advanced content flow mechanism, which can be combined with positioning schemes as defined by other CSS modules such as the Multi-Column Module [CSS3COL] or the Grid Layout Module [CSS3-GRID-LAYOUT] to position the regions where content flows.

更多信息和教程在 http://html.adobe.com/webplatform/layout/regions/

这篇关于如何将文本从DIV流到DIV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆