css columns属性怎么用


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title></title>

    <style>

        p{margin:0;padding:5px 10px;background:#eee;}

        h1{margin:10px 0;font-size:16px;}

        .test1{

            width:628px;

            border:10px solid #000;

            -moz-columns:100px 4;

            -webkit-columns:100px 4;

            columns:100px 4;

        }

        .test2{

            border:10px solid #000;

            -moz-columns:400px;

            -webkit-columns:400px;

            columns:400px;

        }

    </style>

</head>

<body>

<h1>列数及列宽固定:</h1>

<div>

    <p>This module describes multi-column layout in CSS. By using functionality described in this document, style sheets laid out in multiple columns. </p>

    <p>This module describes multi-column layout in CSS. By using functionality described in this document, style sheets laid out in multiple columns. </p>

    <p>On the Web, tables have also been used to describe multi-column layouts. The main benefit of usingn to another on various output devices including speech</p>

    <p>On the Web, tables have also been used to describe multi-column layouts. The main benefit of usingn to another on various output devices including speech synthesizers and small mobile devices.</p>

</div>

<h1>列宽固定,根据内容自动分布列数:</h1>

<div>

    <p>This module describes multi-column layout in CSS. By using functionality described in this document, style sheets can declare that the content of an element is to be laid out in multiple columns. </p>

    <p>On the Web, tables have also been used to describe multi-column layouts. The main benefit of using CSS-based columns is flexibility; content can flow from one column to another, and the number of columns can vary depending on the size of the viewport. Removing presentation table markup from documents allows them to more easily be presented on various output devices including speech synthesizers and small mobile devices.</p>

</div>

</body>

</html>

运行结果

abaa1dd2f823f3c8b8cadd56dd43fa7.png

以上就是css columns属性怎么用的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

html中弹性布局(flex)的介绍(附代码)

css的背景图怎么加边框

css如何实现元素不随滚动条滚动

css如何设置table边框的颜色

css中的流式布局是什么意思

css什么时候用class和id

css怎么写五角星

css怎么实现图片居中

css中的图片翻转属性是什么

css中清除浮动有哪几种方式

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...