当前位置:网站首页>实战案例,深入剖析
实战案例,深入剖析
2022-06-10 12:11:00 【InfoQ】
前言
什么是css块元素?
css块元素的三个特点:
- 每个块级元素都是独自占一行,其后的元素也只能另起一行,并不能两个元素共用一行。
- 元素的高度、宽度、行高和顶底边距都是可以设置的。
- 元素的宽度如果不设置的话,默认为父元素的宽度。
元素特点:
- 在页面中以矩形区域显示。
- 自上而下排列,独占一行
- 可以直接添加宽高
- 一般情况下,作为其他元素或内容的容器
- 《大厂前端面试题解析+Web核心总结学习笔记+企业项目实战源码+最新高清讲解视频》无偿开源 徽信搜索公众号【编程进阶路】在页面中最小单位也是矩形。
- 在一行内逐个排列。
- 不可以直接添加宽高,大小是由内容撑开的。
- 内联元素也符合盒模型的规则,但是个别属性会出现问题(padding-top/bottom margin-top/bottom)
- 内联元素在一行内排列的时候,之间有间距
- 可以设置宽高。
- 默认情况下,在一行内逐个显示,之间有间距。
- 当前元素的display值为inline-block时,能支持vertical-align属性。
常用元素:
元素类型转换:
- display:block;作用:将元素转成块状元素,拥有块状元素特点。补充:大部分块状元素,默认的display的值都是block;
- display:inline;作用:将元素转成内联元素,拥有内联元素的特点。补充:大部分内联元素,默认的display的值inline;
- display:none;作用:将当前隐藏,并不占据空间。
总结






边栏推荐
- (五)类和对象及类的分文件操作(2)
- Yet Another Palindrome Partitioning
- Learning of fm4057s single lithium battery linear charging chip
- 移动端整页滑屏示例(上下滑动整屏)(整理)
- Xijun data cooperates with Alibaba cloud to obtain Alibaba cloud product integration certification!
- (八)初始化列表
- IndexedDB 数据库的使用
- 合集资料,必看
- Shadergraph - water surface
- "Yi +" open source program - Design and practice of low delay player based on webrtc
猜你喜欢

Const Modified member function

Web development

C语言最佳实践之库文件介绍(下)

(五)类和对象及类的分文件操作(2)

嵌入式Linux中使用SQLite3数据库

(10) Notes on null pointer accessing member function and this pointer

Slm4054 independent linear lithium battery charger chip learning

Introduction: from the origin of etcd name to installation, deployment and usage posture

C語言最佳實踐之庫文件介紹(下)

Can chip learning of max3051
随机推荐
mysql8.0安装
(七)深拷贝与浅拷贝
element弹出框关闭并销毁:清空弹出里的数据缓存(整理)
eseses
request获取请求服务器ip地址
IndexedDB 数据库的使用
【已解决】vagrant up下载box速度太慢的解决方法
C# 均衡权重分配
(十)空指针访问成员函数与this指针注意事项
vs2010未定义的标识符 round
Shadergraph - water surface
uni-app解析银行卡(支付宝)返回form表单,唤起支付宝界面
聊聊消息中间件(1),AMQP那些事儿
掌握高性能计算前,我们先了解一下它的历史
期货开户在网上办理安全吗?靠谱吗?
Lua syntax
JS use the Icheck plug-in to listen and get the value of the checkbox
Introduction: from the origin of etcd name to installation, deployment and usage posture
FM4057S单节锂电池线性充电芯片的学习
Add line number field to SQL query results - sqlserver