css中的f弹性盒子模型的应用案例
案例1:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>弹性盒子模型的应用</title>
<style type="text/css">
@charset "utf-8";
* {margin: 0; border: 0; padding: 0;}
body, html {-webkit-touch-callout: none; -webkit-text-size-adjust: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; overflow-x: hidden;font-family:"微软雅黑";}
h1, h2, h3, h4, h5, h6 {font-size: 100%; font-weight: normal;}
footer, header, section {position: relative;}
ol, ul {list-style: none;}
button, input, textarea {border: 0; margin: 0; padding: 0; font-size: 1em; line-height: 1em; background-color: transparent;}
a {color: #1a1a1a;}
a:active, a:hover {outline: 0;}
a, a:visited {text-decoration: none;}
li {list-style:none;}
</style>
</head> <body>
<!--弹性盒子模型的使用-->
<div class="betweens">
<div>正在热映</div>
<div>更多></div>
</div>
<style type="text/css">
.betweens{
padding:15px 10px 11px;
display:flex;
flex-direction:row;
justify-content:space-between;/*内部元素居两边显示*/
/*justify-content:space-around;*/ /*使内部元素平均分配在里面*/
/*justify-content:flex-start;*/ /*默认值。项目位于容器的开头。*/
/*justify-content:flex-end;*/ /*项目位于容器的结尾。*/
/*justify-content:center; */ /*项目位于容器的中心。*/
/*justify-content:initial;*/ /*设置该属性为它的默认值。跟flex-start效果一致*/
/*justify-content:inherit;*/ /*从父元素继承该属性。*/
}
</style>
</body>
</html>
案例2:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<style type="text/css">
@charset "utf-8";
* {margin: 0; border: 0; padding: 0;}
body, html {-webkit-touch-callout: none; -webkit-text-size-adjust: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; overflow-x: hidden;font-family:"微软雅黑";}
h1, h2, h3, h4, h5, h6 {font-size: 100%; font-weight: normal;}
footer, header, section {position: relative;}
ol, ul {list-style: none;}
button, input, textarea {border: 0; margin: 0; padding: 0; font-size: 1em; line-height: 1em; background-color: transparent;}
a {color: #1a1a1a;}
a:active, a:hover {outline: 0;}
a, a:visited {text-decoration: none;}
li {list-style:none;}
</style>
</head> <body>
<div class="movie-list-container">
<div class="inner-container">
<div class="movie-head">
<text class="slogan">正在热映</text>
<div class="more">
<text class="more-text">更多></text>
</div>
</div>
<ul class="movies-container">
<li><div class="movie-img"></div><text class="movie-title">你的名字</text><span class="starsTemplate"></span></li>
<li><div class="movie-img"></div><text class="movie-title">你的名字</text><span class="starsTemplate"></span></li>
<li><div class="movie-img"></div><text class="movie-title">你的名字</text><span class="starsTemplate"></span></li>
</div>
</div>
</div> <style type="text/css">
.movie-list-container{
background-color: #fff;
display: flex;
flex-direction: column;
}
.inner-container{
margin: 0 auto 10px;
}
.movie-head{
padding: 15px 10px 11px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.movie-img{
width: 100px;
height: 135px;
padding-bottom: 10rpx;
background-color:#188eee; }
.movie-title{
margin-bottom: 12px;
font-size: 14px;
}
.starsTemplate{
display:block;
width:80px;
height:20px;
background-color:#F0F;
}
.movies-container{
display: flex;
flex-direction: row;
}
.movies-container li{
display: flex;
flex-direction: column;
padding: 0 11px;
}
</style>
</body>
</html>
css中的f弹性盒子模型的应用案例的更多相关文章
- CSS学习篇核心之——盒子模型
概述 关于CSS的一些基础知识我们在前面文章中已经有所了解,这篇文章我们主要来学习下CSS中的核心知识盒子模型的知识. 盒子模型 元素框的最内部分是实际的内容(element),直接包围内容的是内边距 ...
- 使用css弹性盒子模型
提示: 当期内容不充实, 修改后再来看吧 以下称:弹性子元素: 子元素, 弹性容器: 容器 弹性盒子的属性 1. css弹性盒子模型规定了弹性元素如何在弹性容器内展示 2. 弹性元素默认显示在弹性容器 ...
- CSS box-flex属性,然后弹性盒子模型简介
今天做项目的时候发现一个css3的新属性flex 一.什么是flex 它的作用是能够按照设置好的规则来排列容器内的项目,而不必去计算每一个项目的宽度和边距.甚至是在容器的大小发生改变的时候,都可以重新 ...
- CSS box-flex属性,然后弹性盒子模型简介(转)
一.淡淡的开头语 昨天趁着不想工作的时间间隙闲逛24ways,在My CSS Wish List一文中,见到了个新鲜的CSS属性,就是题目中的box-flex,以前没有见过,顿生疑惑,不知是骡子还是马 ...
- CSS Flexbox 弹性盒子模型
CSS Flexbox 弹性盒子模型 设置元素样式为 display: flex 或 display: inline-flex, 让元素变成flex容器, 从而可以通过flex模式布局它的子元素. f ...
- CSS3中的弹性盒子模型
介绍 在css2当中,存在标准模式下的盒子模型和IE下的怪异盒子模型.这两种方案表示的是一种盒子模型的渲染模式.而在css3当中,新增加了弹性盒子模型,弹性盒子模型是一种新增加的强大的.灵活的布局方案 ...
- CSS 弹性盒子模型
CSS 弹性盒子模型 https://www.w3.org/TR/2016/CR-css-flexbox-1-20160526/ CSS Flexible Box Layout Module Leve ...
- flexbox弹性盒子模型
这几天在做移动端的web开发,遇到了一些问题,之前没有折腾过这方面的东西,这次好好吸收下 css3的flexbox--弹性盒子模型,这个盒模型决定了一个盒子在其他盒子中的分布方式及如何处理可用的空间. ...
- css3弹性盒子模型之box-flex
css3弹性盒子模型之box-flex 浏览器支持 目前没有浏览器支持 box-flex 属性. Firefox 支持替代的 -moz-box-flex 属性. Safari.Opera 以及 Chr ...
随机推荐
- 【apt install】Unable to locate package python3-pip
解决办法: 先 sudo apt update 然后再 sudo apt install python3-pip,完成. 如果还不行的话参考这个:
- Git学习-->GitLab如何屏蔽掉注册功能?
一.背景 最近发现我在公司内部搭建的GitLab平台上关于账号出现了以下几个问题: 莫名其妙出现很多陌生人的账号 团队成员的很多账户注册填写的Email和UserName都不符合规范 本来一开始是打算 ...
- CentOS6.9安装httpd并正确配置静态IP地址
题目要求 在vmware中安装一台虚拟机,操作系统为centos6.9 ip地址为 192.168.56.11 要求: 1.xshell能够连接上此虚拟机 2.此虚拟机必须可以上网 3.使用yum安装 ...
- 【转】Deep Learning(深度学习)学习笔记整理系列之(一)
Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-0 ...
- linux 定时备份
每部主机的任务都不相同,重要的数据也不相同,重要性也不一样,因此,每个人癿备份思考角度都不一样! 有些备份策略是非常有趣的: (1)挂载储存设备进行备份: 挂载设备: 备份的 script #!/bi ...
- shoes的安装前后(一)
最近看到一个模型用到了shoes,准备自己试一试.搞了半天,也安装不成功.直接安装包,gem install shoes,失败, 从rubygems上下载最新版本的shoes 然后安装,成功了.随便写 ...
- Bootstrap table前端分页(ssm版)
说明bootstrap table可以前端分页,也可以后端sql用limit分页.前端分页下性能和意义都不大,故一般情况下不用这种,请看我的另一篇后端分页的博客源码下载地址:https://git.o ...
- Python: 字符串格式化format()函数的使用
python从2.6开始支持format,新的更加容易读懂的字符串格式化方法,从原来的% 模式变成新的可读性更强的 花括号声明{}.用于渲染前的参数引用声明, 花括号里可以用数字代表引用参数的序号, ...
- Jsuop Whitelist
Jsuop使用示例代码 使用jsoup HTML Cleaner 方法进行清除,但需要指定一个可配置的 Whitelist.http://jsoup.org/apidocs/org/jsoup/saf ...
- Vue学习笔记之vue-cli脚手架安装和webpack-simple模板项目生成
vue-cli 是一个官方发布 vue.js 项目脚手架,使用 vue-cli 可以快速创建 vue 项目. GitHub地址是:https://github.com/vuejs/vue-cli 一. ...