首頁 web前端 css教學 塊元素block element和內聯元素inline element_CSS/HTML

塊元素block element和內聯元素inline element_CSS/HTML

May 16, 2016 pm 12:11 PM
element

內聯級元素(inline-level element)中試圖插入區塊級(block-level element)元素。這樣做是不允許的。唯一的能在內聯元素中插入區塊級元素的例外是object標籤。那麼什麼是內聯級元素(inline-level element)和區塊級(block-level element)元素呢? 。

塊元素(block element)一般是其他元素的容器元素,塊元素一般都從新行開始,它可以容納內聯元素和其他塊元素,常見塊元素是段落標籤''P"。 「form"這個塊元素比較特殊,它只能用來容納其他塊元素。了css以後,我們可以改變這個html的預設版面模式,把區塊元素擺放到你想要的位置上去。一種,table based layout和css based layout從一般使用者(不包括視力障礙者、盲人等)的角度來看這兩種佈局,除了頁面載入速度的差別外,沒有其他的差別。用戶不經意點了查看頁面原始碼按鈕後,兩者所表現出來的差異就非常大了。快速的閱讀。的話,那就更容易理解了。貼到一張空白的新紙上。 inline element)一般都是基於語意級(semantic)的基本元素。

Block element and inline element are both concepts in the HTML specification. The basic difference between block elements and inline elements is that block elements generally start on a new line. When CSS control is added, this attribute difference between block elements and inline elements no longer becomes a difference. For example, we can add an attribute such as 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 a variable element 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: Regarding the Chinese name of inline element, there are many kinds of inline elements, inline elements, inline elements, and inline elements. Basically there is no unified translation, just call it whatever you want. In addition, when talking about inline elements, we will think of a display attribute called display:inline; this attribute can fix the famous IE double floating border problem.

block element
* address - address
* blockquote - block quote
* center - alignment block
* dir - directory list
* div - Commonly used block levels are easy and are also the main tags of css layout
* dl - Definition list
* fieldset - form control group
* form - Interactive form
* h1 - Big title
* h2 - Subtitle
* h3 - Level 3 title
* h4 - Level 4 title
* h5 - Level 5 title
* h6 - Level 6 title
* hr - Horizontal dividing line
* isindex - input prompt
* menu - menu list
* noframes - frames optional content, (for browsers that do not support frames, display this block content
* noscript -) optional script content (for browsers that do not support frames) Browsers that do not support script will display this content)
* ol - sorted form
* p - paragraph
* pre - formatted text
* table - table
* ul - unsorted list

Inline element
* a - Anchor point
* abbr - Abbreviation
* acronym - First word
* b - Bold (not recommended)
* bdo - bidi override
* big - big font
* br - line break
* cite - quotation
* code - computer code (required when citing source code)
* dfn - Define field
* em - Emphasis
* font - Font setting (not recommended)
* i - Italic
* img - Picture
* input - Input box
* kbd - Define keyboard text
* label - table label
* q - short quote
* s - underscore (not recommended)
* samp - define sample computer code
* select - project selection
* small - small font text
* span - commonly used inline container, defining text blocks
* strike - underline
* strong - bold emphasis
* sub - bottom Superscript
* sup - Superscript
* textarea - Multi-line text input box
* tt - Telex text
* u - Underline
* var - Define variable

Variable elements
Variable elements determine whether the element is a block element or an inline element according to the context.

* applet - java applet
* button - button
* del - delete text
* iframe - inline frame
* ins - inserted text
* map - picture Block (map)
* object - object object
* script - client script

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

VUE 3 VUE 3 Apr 02, 2025 pm 06:32 PM

它的出局!恭喜Vue團隊完成了完成,我知道這是一項巨大的努力,而且很長時間。所有新文檔也是如此。

使用Redwood.js和Fauna構建以太坊應用 使用Redwood.js和Fauna構建以太坊應用 Mar 28, 2025 am 09:18 AM

隨著最近比特幣價格超過20k美元的攀升,最近打破了3萬美元,我認為值得深入研究創建以太坊

您可以從瀏覽器獲得有效的CSS屬性值嗎? 您可以從瀏覽器獲得有效的CSS屬性值嗎? Apr 02, 2025 pm 06:17 PM

我有人寫了這個非常合法的問題。 Lea只是在博客上介紹瞭如何從瀏覽器中獲得有效的CSS屬性。那樣的是這樣。

在CI/CD上有點 在CI/CD上有點 Apr 02, 2025 pm 06:21 PM

我說的“網站”比“移動應用程序”更合適,但我喜歡Max Lynch的框架:

在WordPress塊編輯器中使用Markdown和本地化 在WordPress塊編輯器中使用Markdown和本地化 Apr 02, 2025 am 04:27 AM

如果我們需要直接在WordPress編輯器中向用戶顯示文檔,那麼最佳方法是什麼?

帶有粘性定位的堆疊卡和一點點的雜物 帶有粘性定位的堆疊卡和一點點的雜物 Apr 03, 2025 am 10:30 AM

前幾天,我發現了科里·金尼文(Corey Ginnivan)網站上的這一點,當您滾動時,彼此之間的卡片堆放集。

比較瀏覽器的響應式設計 比較瀏覽器的響應式設計 Apr 02, 2025 pm 06:25 PM

這些桌面應用程序中有許多目標是同時在不同的維度上顯示您的網站。因此,例如,您可以寫作

為什麼Flex佈局中的紫色斜線區域會被誤認為是'溢出空間”? 為什麼Flex佈局中的紫色斜線區域會被誤認為是'溢出空間”? Apr 05, 2025 pm 05:51 PM

關於Flex佈局中紫色斜線區域的疑問在使用Flex佈局時,你可能會遇到一些令人困惑的現象,比如在開發者工具(d...

See all articles