DIV 高度自适应方法汇总_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:19:05
Original
1306 people have browsed it

2、纯CSS方法实现DIV高度自适应 CSS代码

1            #m1,#m2                                          2            {                                          3            padding-bottom:32767px!important;                                          4            margin-bottom:-32767px!important;                                          5            }                                          6            @media all and  (min-width:0px){                                          7                   #m1,#m2                                          8                   {                                          9                   padding-bottom:0!important;                                           10              margin-bottom:0!important;                                          11              }                                          12              #m1:before,#m2:before                                          13              {                                          14              content:'[DONOTLEAVEITISNOTREAL]';                                          15              display:block;                                          16              background:inherit;                                          17              padding-top:32767px!important;                                          18              margin-bottom:-32767px!important;                                          19              height:0;                                          20              }                                          21       }
Copy after login

3、加背景图片实现DIV高度自适应 html代码:

2

这是第一列

3

这是第二列

45

css代码:

1            #wrap{width:776px;background:url(bg.gif)  repeat-y 300px;}                                          2            #column1{float:left;width:300px;}                                          3            #column2{float:right;width:476px;}                                          4            .clear{clear:both;}
Copy after login

div 自适应高度 css div高度自适应 div背景图片自适应 div里面的内容随屏幕自适应 对于自适应div如何设置字体居中 浮动div自适应网页 js控制div自适应 div根据内容自适应大小 div自适应屏幕高度 div根据内容高度自适应

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template