如何区别内联元素,块状元素,内联块状元素?
小白
小白 2016-12-19 14:15:19
0
2
1224

内联元素->块状元素:display:block

块状元素->内联元素:display:inline

元素->内联块状元素:display:inline-block


小白
小白

好好学习,天天向上!!!

reply all(2)
数据分析师

How to distinguish between inline elements, block elements, and inline block elements? -PHP Chinese website Q&A-How to distinguish between inline elements, block elements, and inline block elements? -PHP Chinese website Q&A

Please watch and learn.

迷茫

在CSS中,html中的标签元素大体被分为三种不同的类型:块状元素、内联元素(又叫行内元素)和内联块状元素。

常用的块状元素有:

<div>、<p>、<h1>...<h6>、<ol>、<ul>、<dl>、<table>、<address>、<blockquote> 、<form>

常用的内联元素有:

<a>、<span>、<br>、<i>、<em>、<strong>、<label>、<q>、<var>、<cite>、<code>

常用的内联块状元素有:

<img>、<input>

下面的只是来自于课程15-9:

有一个有趣的现象就是当为元素(不论之前是什么类型元素,display:none 除外)设置以下 2 个句之一:

position : absolute

float : left 或 float:right

元素会自动变为以 display:inline-block 的方式显示,当然就可以设置元素的 width 和 height 了且默认宽度不占满父元素。

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!