Home Web Front-end HTML Tutorial html块级元素和行内元素_html/css_WEB-ITnose

html块级元素和行内元素_html/css_WEB-ITnose

Jun 24, 2016 am 11:18 AM

  1. 块元素一般都从新行开始,它可以容纳内联元素和其他块元素,常见块元素是段落标签'P"。“form"这个块元素比较特殊,它只能用来容纳其他块元素。   
  2.   
  3. 如果没有css的作用,块元素会顺序以每次另起一行的方式一直往下排。而有了css以后,我们可以改变这种html的默认布局模式,把块元素摆放到你想要 的位置上去。而不是每次都愚蠢的另起一行。需要指出的是,table标签也是块元素的一种,table based layout和css based layout从一般使用者(不包括视力障碍者、盲人等)的角度来看这两种布局,除了页面载入速度的差别外,没有其他的差别。但是如果普通使用者不经意点了 查看页面源代码按钮后,两者所表现出来的差异就非常大了。基于良好重构理念设计的css布局页面源码,至少也能让没有web开发经验的普通使用者把内容快 速的读懂。从这个角度来说,css layout code应该有更好的美学体验吧。   
  4.   
  5. 你能够把块容器元素div想象成一个个box,或者如果你玩过剪贴文载的话,那就更加容易理解了。我们先把需要的文章从各种报纸、杂志总剪 下来。每块剪下来的内容就是一个block。然后我们把这些纸块按照自己的排版意图,用胶水重新贴到一张空白的新纸上。这样就形成了你自己独特的文摘快报 了。作为一种技术的延伸,网页布局设计也遵循了同样的模式。.   
  6.   
  7. 内联元素(inline element)一般都是基于语义级(semantic)的基本元素。内联元素只能容纳文本或者其他内联元素,常见内联元素 “a”。   
  8.   
  9. 块元素(block element)和内联元素(inline element)都是html规范中的概念。块元素和内联元素的基本差异是块元素一般都从新行开始。而当加入了css控制以后,块元素和内联元素的这种属 性差异就不成为差异了。比如,我们完全可以把内联元素cite加上display:block这样的属性,让他也有每次都从新行开始的属性。   
  10.   
  11. 可变元素的基本概念就是他需要根据上下文关系确定该元素是块元素或者内联元素。可变元素还是属于上述两种元素类别,一旦上下文关系确定了他的类别,他就要遵循块元素或者内联元素的规则限制。大致的元素分类见全文。   
  12.   
  13. 关于inline element的中文叫法,有多种内联元素、内嵌元素、行内元素、直进式元素。基本上没有统一的翻译,爱怎么叫怎么叫吧。另外提到内联元素,我们会想到有个display的属性是display:inline;这个属性能够修复著名的IE双倍浮动边界问题。   
  14.   
  15. 块元素(block element)   
  16.   
  17.   * address - 地址   
  18.   * blockquote - 块引用   
  19.   * center - 举中对齐块   
  20.   * dir - 目录列表   
  21.   * div - 常用块级容易,也是css layout的主要标签   
  22.   * dl - 定义列表   
  23.   * fieldset - form控制组   
  24.   * form - 交互表单   
  25.   * h1 - 大标题   
  26.   * h2 - 副标题   
  27.   * h3 - 3级标题   
  28.   * h4 - 4级标题   
  29.   * h5 - 5级标题   
  30.   * h6 - 6级标题   
  31.   * hr - 水平分隔线   
  32.   * isindex - input prompt   
  33.   * menu - 菜单列表   
  34.   * noframes - frames可选内容,(对于不支持frame的浏览器显示此区块内容   
  35.   * noscript - 可选脚本内容(对于不支持script的浏览器显示此内容)   
  36.   * ol - 排序表单   
  37.   * p - 段落   
  38.   * pre - 格式化文本   
  39.   * table - 表格   
  40.   * ul - 非排序列表   
  41.   
  42. 内联元素(inline element)   
  43.   
  44.   * a - 锚点   
  45.   * abbr - 缩写   
  46.   * acronym - 首字   
  47.   * b - 粗体(不推荐)   
  48.   * bdo - bidi override   
  49.   * big - 大字体   
  50.   * br - 换行   
  51.   * cite - 引用   
  52.   * code - 计算机代码(在引用源码的时候需要)   
  53.   * dfn - 定义字段   
  54.   * em - 强调   
  55.   * font - 字体设定(不推荐)   
  56.   * i - 斜体   
  57.   * img - 图片   
  58.   * input - 输入框   
  59.   * kbd - 定义键盘文本   
  60.   * label - 表格标签   
  61.   * q - 短引用   
  62.   * s - 中划线(不推荐)   
  63.   * samp - 定义范例计算机代码   
  64.   * select - 项目选择   
  65.   * small - 小字体文本   
  66.   * span - 常用内联容器,定义文本内区块   
  67.   * strike - 中划线   
  68.   * strong - 粗体强调   
  69.   * sub - 下标   
  70.   * sup - 上标   
  71.   * textarea - 多行文本输入框   
  72.   * tt - 电传文本   
  73.   * u - 下划线   
  74.   * var - 定义变量   
  75.   
  76. 可变元素   
  77.   
  78.   可变元素为根据上下文语境决定该元素为块元素或者内联元素。   
  79.   * applet - java applet   
  80.   * button - 按钮   
  81.   * del - 删除文本   
  82.   * iframe - inline frame   
  83.   * ins - 插入的文本   
  84.   * map - 图片区块(map)   
  85.   * object - object对象   
  86.   * script - 客户端脚本  
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

How to implement adaptive layout of Y-axis position in web annotation? How to implement adaptive layout of Y-axis position in web annotation? Apr 04, 2025 pm 11:30 PM

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

See all articles