Blogger Information
Blog 9
fans 0
comment 0
visits 5675
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
弹性布局之弹性元素-PHP第九期先上班
平胸啊春
Original
550 people have browsed it

弹性布局之弹性元素-PHP第九期先上班

1.弹性元素的增长因子

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>弹性元素的增长因子</title>
    <link rel="stylesheet" href="css/style1.css">
</head>
<body>
<h1>弹性元素的增长因子</h1>
<h3>1.所以弹性元素不增长,以原始宽度现实,增长因子为0</h3>
    <div class="container flex demo1">
        <span class="item">item1</span>
        <span class="item">item2</span>
        <span class="item">item3</span>
    </div>
<h3>2.将剩余空间分配给指定元素比如第三</h3>
<div class="container flex demo2">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>3.将剩余空间按比例均分</h3>
<div class="container flex demo3">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>4.每个弹性元素宽度不同时,同样适用以上分配规律</h3>
<div class="container flex demo4">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
</body>
</html>

执行结果预览图

QQ图片20191110194447.png

手抄代码

QQ图片20191110214742.jpg

2.弹性元素的缩减因子

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>弹性元素的缩减因子</title>
    <link rel="stylesheet" href="css/style2.css">
</head>
<body>
<h3>所有弹性元素不缩减以原始状态显示</h3>
<div class="container flex demo1">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>所有弹性元素自适应盒子宽度自动缩减</h3>
<div class="container flex demo2">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>当三个弹性元素缩减因子不相等时</h3>
<div class="container flex demo3">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
h3>当三个弹性元素缩减因子不相等时</h3>
<div class="container flex demo4">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
</body>
</html>

执行结果预览图

QQ图片20191110221333.png

手抄代码

QQ图片20191110224414.jpg

3.设置弹性元素的基准因子

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>设置弹性元素的基准因子</title>
    <link rel="stylesheet" href="css/style3.css">
</head>
<body>
<h1>flex-basis:设置弹性元素的基准尺寸</h1>
<h3>1.在未设置弹性元素宽度时,以内容宽度现实</h3>
<div class="container flex demo1">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>2.存在自定义元素宽度时,则以该宽度显示</h3>
<div class="container flex demo2">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>3.自动状态下,则有流浪器根据预设值自动判定</h3>
<div class="container flex demo3">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>4.当元素存在自定义宽度与基准宽度时,以基准宽度为准</h3>
<div class="container flex demo4">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>5.设置基准宽度允许百分比</h3>
<div class="container flex demo5">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
</body>
</html>

执行效果预览图

QQ图片20191110224749.png

手抄作业

QQ图片20191110225719.png

4.简化弹性元素的基本设置

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>简化弹性元素的基本设置</title>
    <link rel="stylesheet" href="css/style4.css">
</head>
<body>
<h1>简化弹性元素的基本设置</h1>
<h3>1.根据宽度计算,允许缩减适应容器</h3>
<div class="container flex demo1">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>2.根据宽度计算,元素完全弹性自行应容器</h3>
<div class="container flex demo2">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>3.元素完全失去弹性,以原始大小呈现</h3>
<div class="container flex demo3">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>4.一个数值表示增长因子flex:1;</h3>
<div class="container flex demo4">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
h3>5.当有基准尺寸是以基准尺寸为准;</h3>
<div class="container flex demo5">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
h3>6.单独设置某个元素弹性的大小;</h3>
<div class="container flex demo6">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>7.align-leif 侧轴</h3>
<div class="container flex demo7 self">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
<h3>8.order 属性 设置或检索弹性盒模型对象的子元素出现的順序</h3>
<div class="container flex demo8 ">
    <span class="item">item1</span>
    <span class="item">item2</span>
    <span class="item">item3</span>
</div>
</body>
</html>

执行效果预览图

QQ图片20191110230054.pngQQ图片20191110231346.png

手抄代码

QQ图片20191110231947.png

圣杯布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>圣杯布局</title>
    <link rel="stylesheet" href="css/style5.css">
</head>
<body>
    <header>头部</header>
    <main><!--内容区-->
       <article>
           主体区
       </article>
        <aside>
            左边栏
        </aside>
        <aside>
            右边栏
        </aside>
    </main>
    <footer>
        底部
    </footer>
</body>
</html>

执行效果预览

QQ图片20191110232258.png

手抄代码

QQ图片20191110233404.png

Correction status:qualified

Teacher's comments:代码风骚, 手写霸气, 博客名称更是让人过目永不忘, 希望你把这股精神用在以后的学习中, 一定能功成名就,成就一番霸业
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments