博客
关于我
伸缩布局小练习
阅读量:225 次
发布时间:2019-03-01

本文共 2582 字,大约阅读时间需要 8 分钟。

越学越没动力,但是,我会给自己打气的!

移动端显示需要加“视口”,使当前页面宽度等于设备宽度。

下面是整体布局中的默认样式!

* {               margin: 0;            padding: 0;            list-style: none;        }        html {               font-size: 10px;        }        body {               font-size: 1.6rem;            background-color: #e8e8e8;        }

下面是页面中的内容。

推荐
热点
视频
娱乐
军事
最新的温馨电视剧,你看过吗?
小时刻
1-21

新闻事件调查:是否人人都能够成为一个合格的搬砖人!新闻事件调查:是否人人都能够成为一个合格的搬砖人!新闻事件调查:是否人人都能够成为一个合格的搬砖人!

环球网 11-26

这个是剩下的样式!

.bd-header span {               padding: 0.3rem;        }        .bd-header span.current {               color: #cccccc;        }        .bd-content {               margin-top: 5rem;        }        .bd-content .cell1,        .cell2{               padding: 0.5rem;            background-color:#ffffff;            border-bottom: 0.1rem solid #e8e8e8;        }        .bd-content .cell1-center {               /*父盒子作伸缩布局*/            display: flex;            justify-content: space-around;            align-items: center;        }        .bd-content .cell1-center div {               /*background-color: #999999;*/            /*这个是子盒子*/            /*height: 6rem;这个取消了的话,是取决于图片的高度。*/            flex: 1;            padding: 1rem;        }        .bd-content .cell1-center div img{               width: 100%;        }        /*父窗口为cell2,后面两个为子窗口,一个占6分之2,一个占6分之4*/        .bd-content .cell2{               display: flex;        }        .bd-content .cell2-left{               flex: 2;        }        .bd-content .cell2-left img{               width: 100%;            height: 100%;        }        .bd-content .cell2-right{               flex: 4;            /*background-color: green;*/            /*伸缩布局,针对里面的元素*/            display: flex;            /*垂直方向布局*/            flex-direction: column;            margin-left: 0.1rem;        }        .bd-content .cell2-right p:first-child{               flex: 1;            height: 2rem;            line-height:2.5rem;            overflow: hidden;            /*background-color: #e74c3c;*/        }

效果如图!

在这里插入图片描述

转载地址:http://xgjv.baihongyu.com/

你可能感兴趣的文章
MySQL 8.0开始Group by不再排序
查看>>
mysql ansi nulls_SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON 什么意思
查看>>
multi swiper bug solution
查看>>
MySQL Binlog 日志监听与 Spring 集成实战
查看>>
MySQL binlog三种模式
查看>>
multi-angle cosine and sines
查看>>
Mysql Can't connect to MySQL server
查看>>
mysql case when 乱码_Mysql CASE WHEN 用法
查看>>
Multicast1
查看>>
mysql client library_MySQL数据库之zabbix3.x安装出现“configure: error: Not found mysqlclient library”的解决办法...
查看>>
MySQL Cluster 7.0.36 发布
查看>>
Multimodal Unsupervised Image-to-Image Translation多通道无监督图像翻译
查看>>
MySQL Cluster与MGR集群实战
查看>>
multipart/form-data与application/octet-stream的区别、application/x-www-form-urlencoded
查看>>
mysql cmake 报错,MySQL云服务器应用及cmake报错解决办法
查看>>
Multiple websites on single instance of IIS
查看>>
mysql CONCAT()函数拼接有NULL
查看>>
multiprocessing.Manager 嵌套共享对象不适用于队列
查看>>
multiprocessing.pool.map 和带有两个参数的函数
查看>>
MYSQL CONCAT函数
查看>>