当前位置:网站首页>盒子模型、文档流、定位、布局和响应式设计
盒子模型、文档流、定位、布局和响应式设计
2022-07-16 04:22:00 【猿婴】
title: “盒子模型、文档流、定位、布局和响应式设计”
盒子模型
当我们设置盒子的宽度与高度的时候,设置的是 content 的高度与宽度,padding 和 border 没有被计算进去。 可通过 box-sizing 设置盒子模型的大小,默认情况下是值 content-box,即计算内容区计算盒子大小。实际项目中,会按照 border-box 计算盒子大小,会将盒子外边框(margin)设置为 0。
文档流
盒子在文档中如何排列,即行内块元素和块元素。
定位
坐标定位
- static:位置不会发生变化。
- relative:指元素相对其所在文档流的位置坐标,元素在文档流中的原始位置被保留,不会影响其它元素的位置。
- absolute:脱离文档流,并且会查找第一个非 static 的父元素作为其相对坐标参照物。
- fixed:脱离文档流,针对窗口进行定位。
浮动定位
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-WXnnDd5B-1657132434434)(https://raw.githubusercontent.com/Coder-itCheng/blog-images/master/blog/image-20220707021103428-16571310651877-165713109780611.png "浮动前")]](/img/f5/4f8eebe31d7d516fdaaee0cc31b164.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IMZx1ljc-1657132434436)(https://raw.githubusercontent.com/Coder-itCheng/blog-images/master/blog/image-20220707021124229-16571310962799.png "浮动后")]](/img/fc/ae6e6e222586b6275354edac71a746.png)
页面布局
Flex 布局
Flex 容器
- 排列方向(
flex-direction)
注意:反转的时候开始和结束位置页反转了
溢出处理(
flex-wrap):no-wrap、wrap、wrap-reverse
对齐方式(
align-items(纵向)和justify-content(横向)):flex-start、center、space-between、space-around、flex-end

注意:反转之后,纵向变横向,横向变纵向。
Flex元素
- flex-grow、flex-shrink、flex-basis





Grid 布局





命名区域
浮动区域
响应式 web 设计
视窗响应:在不同视窗中保证网页按原始大小占据屏幕,不会发生像素缩放。
样式响应
像素响应
图片响应
边栏推荐
- Dls-42/4-4 dc110v double position relay
- Single cell literature learning (Part4) -- scanpy: large scale single cell gene expression data analysis
- Static routing technology
- QA robot section 1 - Introduction
- 老子云3D产品及服务全介绍,一张图告诉你如何选!
- 【luogu AT2230】Water Distribution(状压DP)(最小生成树)
- 三条线(春季每日一题 59)
- 记一篇IT培训日记068-心里有点不平衡
- 2.18 haas506 2.0 development tutorial - communication between Alibaba cloud M2M devices - rule engine /topic message routing (only versions above 2.2 are supported)
- micro、M3O微服务系列(一)
猜你喜欢

Expert routine of BW conversion based on AMDP

Sword finger offer 28 Symmetric binary tree
![Guess the size of the number ii[what problem does dynamic planning solve?]](/img/a0/6f94899557df7aff18377411cc10a8.png)
Guess the size of the number ii[what problem does dynamic planning solve?]

Sword finger offer 42 Maximum sum of continuous subarrays

ORA-19625异常处理记录

AB PLC学习笔记

Sword finger offer 27 Image of binary tree

leetcode - 面试题 02.05. 链表求和

After Jay Chou's co branded model, Fang Wenshan brought online shopping to promote the collection of "Hualiu" top-level co branded dolls

layoutgan:generating graphic layouts with wiregrame discriminators
随机推荐
Micro, m3o micro service series (II)
5、 Basic composition & assertion of JMeter script
ubuntu 18.04 使用 tar包安装mysql5.7.35
Three horses join hands with Qianyuan public welfare foundation | cool in summer, pay tribute to the adherents!
Software testing zero basic testing - Basic Concepts
[Luogu at2230] water distribution (pressure DP) (minimum spanning tree)
解决Filter中获取body内容报错,getReader() has already been called for this request
Sword finger offer 50 The first character that appears only once
Why does QT creator compile so slowly?
Esp8266+blinker+web distribution network
Sword finger offer 04 Search in two-dimensional array
DSP-Core类库的.NET版本降级
Sword finger offer 32 - I. print binary tree from top to bottom, breadth first search (queue)
[TinyML]NetAug:Network Augmentation for Tiny Deep Learning
【目标跟踪】基于背景消减的图像帧间差分法目标检测及matlab仿真
filebeat收集kubernetes集群日志
Dls-42/4-4 dc110v double position relay
Tools to measure the gap between two distributions: cross entropy and KL divergence
Leetcode - interview question 02.05 List summation
Expert routine of BW conversion based on AMDP