当前位置:网站首页>行内元素和块级元素有什么区别?语义化作用
行内元素和块级元素有什么区别?语义化作用
2022-07-28 20:15:00 【大鸡腿最好吃】
常见的行内元素
a,span,input,img
img,input为特殊的行内元素,可以设置宽高
常用的块级元素
div,h1-h6,p,ul,li,form
区别
行内元素不换行,宽高不可以设置,只能让他的子元素撑起来,内边距和外边距只在水平方向有效(对它周围的元素产生影响),内边距垂直方向显示效果增加,位置上不会有改变
块级元素自动换行,可以设置宽高,可以设置 margin、padding
display:inline块级转行内
display;block 行内转块级
display:inline-block行内元素或块级元素转行内块元素
语义化作用
- 对于编写代码的人来说,有语义化标签的HTML的结构,更加清晰,方便编写代码;
- 对于团队来说,方便团队的开发与维护;
- 对于浏览器,更加方便解析,
- 对于爬虫,有利于SEO;
边栏推荐
- 比UUID更快更安全NanoID到底是怎么实现的?(荣耀典藏版)
- 开放式耳机哪个音质好、公认音质好的气传导耳机推荐
- 什么是质因数,质因数(素因数或质因子)在数论里是指能整除给定正整数的质数
- The general strike of three factories in St France may make the shortage of chips more serious!
- ESP8266-Arduino编程实例-深度休眠与唤醒
- 中文招聘文档中专业技能词抽取的跨域迁移学习
- 基于属性词补全的武器装备属性抽取研究
- Lt7911d type-c/dp to Mipi scheme is mature and can provide technical support
- Rhcsa first day
- 基于知识元的外文专利文献知识描述框架
猜你喜欢

软考 --- 数据库(3)数据操作

Apifox:满足你对 Api 的所有幻想

OA项目之会议通知(查询&是否参会&反馈详情)

微信小程序开发入门,自己开发小程序

How to design workflow engine gracefully (glory Collection Edition)
![[Bluetooth Bluetooth development] VIII. Transmission layer of ble protocol](/img/43/7c3891befcb7cbb7dc67dfdeb763e2.png)
[Bluetooth Bluetooth development] VIII. Transmission layer of ble protocol

Vimtutor编辑

纳米金偶联抗体/蛋白试剂盒(20nm,1mg/100μg/500 μg偶联量)的制备

管理区解耦架构见过吗?能帮客户搞定大难题的

基于属性词补全的武器装备属性抽取研究
随机推荐
Esp8266 Arduino programming example - SPIFs and data upload (Arduino IDE and platformio IDE)
Skiasharp's WPF self drawn drag ball (case version)
Log slimming operation: how to optimize from 5g to 1g! (glory Collection Edition)
微信小程序开发公司你懂得选择吗?
如何优雅的设计工作流引擎(荣耀典藏版)
openEuler Embedded SIG | 分布式软总线
HYDAC溢流阀DB08A-01-C-N-500V
基于属性词补全的武器装备属性抽取研究
[英雄星球七月集训LeetCode解题日报] 第28日 动态规划
B+ tree height calculation of MySQL
MSI Bao'an factory is on fire! Official response: no one was injured, and the production line will not be affected!
Bully is filed for bankruptcy! The company has become a "Lao Lai", and the legal person is restricted from high consumption
RHCSA第一天
Explain the remote debugging program of visual studio 2015 in LAN
What is the purpose of database read-write separation [easy to understand]
The University was abandoned for three years, the senior taught himself for seven months, and found a 12K job
基于知识元的外文专利文献知识描述框架
这种动态规划你见过吗——状态机动态规划之股票问题(下)
I have been in the industry for 4 years and changed jobs twice. I have understood the field of software testing~
开放式耳机哪个音质好、公认音质好的气传导耳机推荐