国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

directory search
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
characters

在 HTML 中, 行內(nèi)元素是那些只占用定義元素的標記所限定的空間, 而不是破壞內(nèi)容的流。在本文中, 我們將檢查 HTML 內(nèi)聯(lián)元素以及它們與塊級元素的區(qū)別。

行內(nèi)元素不會在新行上開始, 只需要盡可能多的寬度。

行內(nèi)元素與塊級元素對比

這是最容易用一個簡單的例子來證明。首先,我們將使用一些簡單的CSS:

.highlight {
  background-color:#ee3;}

行內(nèi)

首先,讓我們看看下面的示例,它演示了一個內(nèi)聯(lián)元素:

<p>The following span is an <span class="highlight">inline element</span>;its background has been colored to display both the beginning and end ofthe inline element's influence.</p>

在此示例中, <p> (段落) 塊級元素包含一些文本。在該文本中, 是一個 <span> 元素, 它是一個內(nèi)聯(lián)元素。由于<span>元素是內(nèi)聯(lián)的,因此該段落正確呈現(xiàn)為單個完整的文本流,如下所述:

塊級別

現(xiàn)在,讓我們將該<span>更改為塊級元素,如<div>:

<p>The following div is an <div class="highlight">block-level element;</div>its background has been colored to display both the beginning and end ofthe block-level element's influence.</p>

使用與之前相同的CSS呈現(xiàn),我們得到:

看到區(qū)別了嗎?<div> 元素完全更改文本的布局, 將其拆分為三段: 在 <div> 之前的文本, 然后是 <div> 的文本, 最后是后面的文本 <div>。

更改元素級別

您可以使用 "CSS 顯示" 屬性更改元素的級別。內(nèi)嵌塊, 通過將顯示的值從 "內(nèi)聯(lián)" 更改為 "block", 可以告訴瀏覽器在塊框中而不是在內(nèi)聯(lián)框中呈現(xiàn)內(nèi)聯(lián)元素。它不一定會使元素呈現(xiàn)出與原來的內(nèi)嵌塊完全一樣的效果, 因此請務必查看結果。

概念差異

簡而言之,下面是內(nèi)聯(lián)和塊級元素之間的基本概念差異:

內(nèi)容模型。通常,內(nèi)聯(lián)元素可能只包含數(shù)據(jù)和其他內(nèi)聯(lián)元素。您不能將塊元素放在內(nèi)聯(lián)元素中.FormattingBy默認情況下,內(nèi)聯(lián)元素不會強制在文檔流中開始一個新行。另一方面,塊元素通常會導致?lián)Q行(雖然像往常一樣,這可以使用CSS進行更改)。

行內(nèi)元素列表

以下元素默認為內(nèi)聯(lián):

<a> <b> <big> <i> <small> <tt> <abbr> <acronym> <cite> <code> <dfn> <em> <kbd> <strong> <samp> <time> <var> <bdo> <br> <img> <map> <object> <q> <script> <span> <sub> <sup> <button> <input> <label> <select> <textarea>

Previous article: Next article: