博客
关于我
伸缩布局小练习
阅读量: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中怎样使用update更新某列的数据减去指定值
查看>>
Mysql中怎样设置指定ip远程访问连接
查看>>
mysql中数据表的基本操作很难嘛,由这个实验来带你从头走一遍
查看>>
Mysql中文乱码问题完美解决方案
查看>>
mysql中的 +号 和 CONCAT(str1,str2,...)
查看>>
Mysql中的 IFNULL 函数的详解
查看>>
mysql中的collate关键字是什么意思?
查看>>
MySql中的concat()相关函数
查看>>
mysql中的concat函数,concat_ws函数,concat_group函数之间的区别
查看>>
MySQL中的count函数
查看>>
MySQL中的DB、DBMS、SQL
查看>>
MySQL中的DECIMAL类型:MYSQL_TYPE_DECIMAL与MYSQL_TYPE_NEWDECIMAL详解
查看>>
MySQL中的GROUP_CONCAT()函数详解与实战应用
查看>>
MySQL中的IO问题分析与优化
查看>>
MySQL中的ON DUPLICATE KEY UPDATE详解与应用
查看>>
mysql中的rbs,SharePoint RBS:即使启用了RBS,内容数据库也在不断增长
查看>>
mysql中的undo log、redo log 、binlog大致概要
查看>>
Mysql中的using
查看>>
MySQL中的关键字深入比较:UNION vs UNION ALL
查看>>
mysql中的四大运算符种类汇总20多项,用了三天三夜来整理的,还不赶快收藏
查看>>