呃。。。这个会不会太基础了。最近在复习,所以基础知识也不能够忽略。

根据HTML 4.01 规范,其描述如下(http://www.w3.org/TR/html401/struct/global.html#h-7.5.3):

1. 内容模型:block元素可以包含block元素和inline元素,inline元素可以包含数据和其他inline元素(就是说inline不能包含block)。核心思想就是相比inline元素,block元素构建的结构都“比较大”。

2. 格式:默认,block元素之间有换行,inline元素之间没有。

3. 文本方向:在实现文本方向上,block元素和inline元素有差别。block元素会继承dir属性,inline不会。

原文:

7.5.3 Block-level and inline elements

Certain HTML elements that may appear in BODY are said to be "block-level" while others are "inline" (also known as "text level"). The distinction is founded on several notions:

Content model
Generally, block-level elements may contain inline elements and other block-level elements. Generally, inline elements may contain only data and other inline elements. Inherent in this structural distinction is the idea that block elements create "larger" structures than inline elements.
Formatting
By default, block-level elements are formatted differently than inline elements. Generally, block-level elements begin on new lines, inline elements do not. For information about white space, line breaks, and block formatting, please consult the section on text.
Directionality
For technical reasons involving the [UNICODE] bidirectional text algorithm, block-level and inline elements differ in how they inherit directionality information. For details, see the section on inheritance of text direction.

Style sheets provide the means to specify the rendering of arbitrary elements, including whether an element is rendered as block or inline. In some cases, such as an inline style for list elements, this may be appropriate, but generally speaking, authors are discouraged from overriding the conventional interpretation of HTML elements in this way.

The alteration of the traditional presentation idioms for block level and inline elements also has an impact on the bidirectional text algorithm. See the section on the effect of style sheets on bidirectionality for more information.

关于block元素和inline元素的更多相关文章

  1. block元素和inline元素的特点

    一.block元素的特点 1.处于常规流中时,如果width没有设置,会自动填充满父容器 2.可以设置height/width及margin/padding 3.处于常规流中时,布局在前后元素位置之间 ...

  2. display:block、display:inline与displayinline:block的概念和区别

    总体概念 block和inline这两个概念是简略的说法,完整确切的说应该是 block-level elements (块级元素) 和 inline elements (内联元素).block元素通 ...

  3. html中的块元素(Block)和内联元素(Inline)(转)

    我们首先要了解,所有的html元素,都要么是块元素(block).要么是内联元素(inline).下面了解一下块元素.内联元素各自的特点: 块元素(block)的特点: 1.总是在新行上开始:2.高度 ...

  4. 块状元素和内联元素 【inline block】

    // 9) { colorRandom += colorArray[randomV - 10]; } else { colorRandom += randomV; } } currentEle.css ...

  5. 多个inline元素、block元素、inline-block元素在父容器中的换行情况

    1.首先看inine元素的换行情况 <style> *{padding:0;margin:0} div.wrap{width:200px;height:200px;border:1px s ...

  6. CSS中的块级元素(block)与行内元素(inline)

    css中有3种基本的定位机制:普通流(相对定位实际上看做普通流定位模型的一部分)浮动(float)绝对定位(固定定位是绝对定位的一种)所以在学习浮动之前,我们先要了解块级元素与内联元素(行内元素).块 ...

  7. 当inline元素包裹block元素时会发生什么

    经常有图片链接写法如下: <a href="www.baidu.com"><img src="baidu.jpg" /></a&g ...

  8. inline元素、block元素、inline-block元素

    inline 内联元素:是不可以控制宽和高.margin等:并且在同一行显示,不换行,直到该行排满. block 块级元素:是可以控制宽和高.margin等,并且会换行.块级对象元素会单独占一行显示, ...

  9. 关于block和inline元素的float

    CSS float 浮动属性 本篇主要介绍float属性:定义元素朝哪个方向浮动. 目录 1. 页面布局方式:介绍文档流.浮动层以及float属性. 2. float:left :介绍float为 l ...

随机推荐

  1. 激活函数sigmoid、tanh、relu、Swish

    激活函数的作用主要是引入非线性因素,解决线性模型表达能力不足的缺陷 sigmoid函数可以从图像中看出,当x向两端走的时候,y值越来越接近1和-1,这种现象称为饱和,饱和意味着当x=100和x=100 ...

  2. Maven 配置tomcat插件

    使用tomcat插件来访问maven 1 先下载tomcat插件(在pom中配置) <!-- 配置Tomcat插件 --> <plugin> <groupId>or ...

  3. ECCV 2018 | Bi-Real net:超XNOR-net 10%的ImageNet分类精度

    这项工作由香港科技大学,腾讯 AI lab,以及华中科技大学合作完成,目的是提升二值化卷积神经网络(1-bit CNN)的精度.虽然 1-bit CNN 压缩程度高,但是其当前在大数据集上的分类精度与 ...

  4. mybatis Dynamic SQL动态 SQL

    动态 SQL MyBatis 的强大特性之一便是它的动态 SQL.如果你有使用 JDBC 或其它类似框架的经验,你就能体会到根据不同条件拼接 SQL 语句的痛苦.例如拼接时要确保不能忘记添加必要的空格 ...

  5. 怎么爆加密过后的前端JS

    网站地址,保密,下面进入主题 页面元素和JS代码 无法看 用谷歌浏览器,选择器选中提交按钮,注意看界面元素源码 onclick="$('#submitForm').submit()" ...

  6. 关于pthreads的使用

    产品想实现PHP端的多线程下载 百度了下找到了一个方法,通常需要开启PHP线程安全策略,就是 编译安装的时候  --enable-maintainer-zts 然后安装pthreads扩展, 但是pt ...

  7. Latex 箭头、下标、符号上下写文字、正方形和三角形

    0. hat   $abc\hat def$  $ab\widehat{cde}f$ 1. 箭头上的文字    $\underrightarrow{\text{你的文字}}$  ($A \xlefta ...

  8. zabbixzabbix

    一,安装文档    https://www.zabbix.com/documentation/4.0/zh/manual/installation/requirements zabbix3.2.6安装 ...

  9. 5.log4j报错

    java.lang.UnsupportedClassVersionError: org/apache/log4j/Logger : Unsupported major.minor version 51 ...

  10. mysql插入json数据

    data_dict = {"a":1, "b":2}  data_json = json.dumps(data_dict) data_escape = MySQ ...