If there is no effect of css , the block elements will be sequentially arranged one line at a time. With css, we can change the default layout mode of html and place the block elements where you want . Instead of stupidly starting a new line every time. It should be pointed out that the table tag is also a type of block element. table based layout and css based layout are common to ordinary users (excluding eyesight). From the perspective of people with disabilities, blind people, etc.), there is no other difference between the two layouts except the difference in page loading speed. However, if an ordinary user inadvertently clicks the View page source code button, the difference between the two will be very large. The css layout page source code designed based on the concept of good reconstruction can at least allow ordinary users without web development experience to convert content quickly Read it. From this perspective, css layout code should have a better aesthetic experience.
You can think of the block container element div as boxes , or if you It will be easier to understand if you have played Cut and Paste. We first cut out the necessary articles from various newspapers and magazines. The cut content of each block is a block. Then we glued these pieces of paper onto a new piece of blank paper according to our layout intention. This will form your own unique digest . As an extension of the technology, web layout design follows the same pattern. .
Inline elements(inline element) are generally based on semantic level (semantic )'s basic element. Inline elements can only accommodate text or other inline elements. The common inline element "a".
Both block element and inline element Concepts in the html specification. The basic difference between block elements and inline elements is that block elements generally start on a new line. And when css control is added, this attribute difference between block elements and inline elements does not become a difference. For example, we can add the attribute display:block to the inline element cite, so that it also has the attribute of starting from a new line every time.
The basic concept of variable elements is that it needs to determine whether the element is a block element or an inline element based on the context.Variable elements still belong to the above two element categories. Once the context determines its category, it must follow the rules of block elements or inline elements. See full text for rough element classification.
ps:About the Chinese name of inline element, there are many inline elements , inline elements, inline elements, and inline elements. Basically there is no unified translation, just call it whatever you want. In addition, when it comes to inline elements, we will think of display whose attribute is display:inline;This attribute can repair the famous IE SPAN>Double floating boundary problem.
块元素(block element)
* address - 地址
* blockquote - 块引用
* center - 举中对齐块
* dir - 目录列表
* div - 常用块级容易,也是css layout的主要标签
* dl - 定义列表
* fieldset - form控制组
* form - 交互表单
* h1 - 大标题
* h2 - 副标题
* h3 - 3级标题
* h4 - 4级标题
* h5 - 5级标题
* h6 - 6级标题
* hr - 水平分隔线
* isindex - input prompt
* menu - 菜单列表
* noframes - frames可选内容,(对于不支持frame的浏览器显示此区块内容
* noscript - )可选脚本内容(对于不支持script的浏览器显示此内容)
* ol - 排序表单
* p - 段落
* pre - 格式化文本
* table - 表格
* ul - 非排序列表
内联元素(inline element)
* a - 锚点
* abbr - 缩写
* acronym - 首字
* b - 粗体(不推荐)
* bdo - bidi override
* big - 大字体
* br - 换行
* cite - 引用
* code - 计算机代码(在引用源码的时候需要)
* dfn - 定义字段
* em - 强调
* font - 字体设定(不推荐)
* i - 斜体
* img - 图片
* input - 输入框
* kbd - 定义键盘文本
* label - 表格标签
* q - 短引用
* s - 中划线(不推荐)
* samp - 定义范例计算机代码
* select - 项目选择
* small - 小字体文本
* span - 常用内联容器,定义文本内区块
* strike - 中划线
* strong - 粗体强调
* sub - 下标
* sup - 上标
* textarea - 多行文本输入框
* tt - 电传文本
* var - 定义变量
可变元素
可变元素为根据上下文语境决定该元素为块元素或者内联元素。
* applet - java applet
* button - 按钮
* del - 删除文本
* iframe - inline frame
* ins - 插入的文本
* map - 图片区块(map)
* object - object对象
* script - 客户端脚本
<span style="FONT-SIZE: 10.5pt"></span>
<span style="FONT-SIZE: 10.5pt"><p>This is a paragraph with <em>an inline element</em> within it.</p></span>
<span style="FONT-SIZE: 10.5pt"></span>
<span style="FONT-SIZE: 10.5pt"><book></book></span>
<span style="FONT-SIZE: 10.5pt"> <maintitle>Cascading Style Sheets: The Definitive Guide</maintitle></span>
<span style="FONT-SIZE: 10.5pt"> <subtitle>Second Edition</subtitle></span>
<span style="FONT-SIZE: 10.5pt"> <author>Eric A. Meyer</author></span>
<span style="FONT-SIZE: 10.5pt"> <publisher>O'Reilly and Associates</publisher></span>
<span style="FONT-SIZE: 10.5pt"> <pubdate>2004</pubdate></span>
<span style="FONT-SIZE: 10.5pt"> <isbn>blahblahblah</isbn></span>
<span style="FONT-SIZE: 10.5pt"></span>
<span style="FONT-SIZE: 10.5pt"><book></book></span>
<span style="FONT-SIZE: 10.5pt"> <maintitle>CSS2 Pocket Reference</maintitle></span>
<span style="FONT-SIZE: 10.5pt"> <author>Eric A. Meyer</author></span>
<span style="FONT-SIZE: 10.5pt"> <publisher>O'Reilly and Associates</publisher></span>
<span style="FONT-SIZE: 10.5pt"> <pubdate>2004</pubdate></span>
<span style="FONT-SIZE: 10.5pt"> <isbn>blahblahblah</isbn></span>
<span style="FONT-SIZE: 10.5pt"></span>
<span style="FONT-SIZE: 10.5pt">默认的显示:</span>
<span> <img alt="" src="http://www.webjx.com/files/allimg/080827/0125162.png"></span>
<span style="FONT-SIZE: 10.5pt">用</span><span style="FONT-SIZE: 10.5pt">css</span><span style="FONT-SIZE: 10.5pt">来定义显示层次:</span>
<span style="FONT-SIZE: 10.5pt">book, maintitle, subtitle, author, isbn {display: block;}</span>
<span style="FONT-SIZE: 10.5pt">publisher, pubdate {display: inline;}</span>
<span style="FONT-SIZE: 10.5pt">现在显示:</span>
<span> <img alt="" src="http://www.webjx.com/files/allimg/080827/0125163.png"></span>