• \n
    \n----------codes------\n----------------------\n<\/div>\n<\/body>\n<\/html><\/pre>\n

    一般來(lái)說(shuō),每個(gè) HTML 標(biāo)籤都有其預(yù)先定義的結(jié)構(gòu)和功能。 HTML 中的區(qū)塊元素具有我們將在文件中使用的不同標(biāo)籤。下面列出了一些標(biāo)籤。 <\/p>\n

    標(biāo)籤:<\/strong><\/p>\n

    ,<\/p>\n


    \n、、、

    -

    、、
    、<\/h6>\n<\/h1>\n
  • 、、、 、
      、


      \n、、、<\/p>\n、

        、\n

        提到的標(biāo)籤是 HTML 中預(yù)先定義的區(qū)塊元素。在 HTML 文件中呼叫時(shí),每個(gè)標(biāo)籤都有不同的功能。最有可能的是,我們使用 <\/p>\n

        ;區(qū)塊級(jí)元素中的標(biāo)籤。程式碼是HTML中區(qū)塊級(jí)元素的通用語(yǔ)法,在需要時(shí)我們也會(huì)使用上述的預(yù)定義標(biāo)籤;每個(gè)標(biāo)籤都會(huì)有獨(dú)立且獨(dú)立的 HTML 內(nèi)容。 \n

        區(qū)塊元素在 HTML 中如何運(yùn)作? <\/h3>\n

        它將使用 CSS 樣式和格式化模型,並覆蓋內(nèi)聯(lián)和區(qū)塊元素。最有可能的是,它會(huì)負(fù)責(zé)格式化區(qū)塊元素。格式化區(qū)塊元素是 HTML 中區(qū)塊級(jí)元素之一。每個(gè) CSS 元素看起來(lái)都像一個(gè)表單;它包含一個(gè)盒子,其中包含一些元件,如內(nèi)容、填充和邊框;這些是 CSS 樣式中的不同元件。 <\/p>\n

          \n
        • \n內(nèi)容:<\/strong>表示文字、圖片、影片等HTML元素的一般內(nèi)容<\/li>\n
        • \nPadding:<\/strong>表示按格式覆蓋到任何內(nèi)容中的任何填充,如 padding-top、padding-left、padding-right、padding-bottom 等。這些是屬性。 <\/li>\n
        • \n邊框:<\/strong>表示 HTML 內(nèi)容中的任何邊框和填充;我們使用 border-top、border-bottom 等設(shè)定邊框<\/li>\n<\/ul>\n

          區(qū)塊元素想要設(shè)定 HTML 文件中的邊距和填滿(mǎn)。因?yàn)榫W(wǎng)頁(yè)需要適當(dāng)?shù)膶?duì)齊才能讓用戶(hù)看起來(lái)更有吸引力。在某些情況下,區(qū)塊元素部分包含元素外部的邊距;元素內(nèi)部的填充將圍繞內(nèi)容。如果您需要元素的背景顏色或圖像,您可以指定它們,它們將顯示在內(nèi)容和填充區(qū)域中。一般來(lái)說(shuō),邊距區(qū)域是透明的並顯示父元素的背景。但是,如果父元素(例如正文部分)尚未指派任何顯示屬性,則會(huì)發(fā)生異常。在這種情況下,邊距和填滿(mǎn)區(qū)域都顯示顏色或影像。邊距是指 HTML 元素外緣之間的距離,包括內(nèi)容和內(nèi)邊距。 <\/p>\n

          我們也設(shè)定了邊框以突出網(wǎng)頁(yè),包括邊框顏色、樣式、寬度和邊距。我們控制元素周?chē)吙虻耐庥^,並可以指定各種邊框類(lèi)型。 CSS 的 border-style 屬性使用戶(hù)能夠設(shè)定自己的自訂邊框樣式,指定的值包括 none、solid、double、hidden、dotted、dashed、groove、ridge、inset 和 outset。如果我們將文件與邊框?qū)R,則不指定任何值表示預(yù)設(shè)值為無(wú);這表示沒(méi)有為您的頁(yè)面指派邊框。除了隱藏值外,所有這些邊框樣式都包含在 css1 版本中,隱藏值是在 css2 版本中新增的。 <\/p>\n

          Starting from HTML 4, the div element is a block-level element for designing documents with specified divisions. Div elements lack specific formatting characteristics by default. However, you can still use the deprecated Align attributes in HTML to the center or align content to the right side; it’s a default in deprecated elements in HTML. In

          tag was intended to take any format in CSS styles, and div has the options like nested div tags and other elements nested with div elements whatever styles, borders, and alignments we specified it would affect for those nested elements. Some basic codes for div tags with border, background image, and other user-defined format styles.<\/p>\n

          Code:<\/strong><\/p>\n\n\n

          div.sample {width:150px;background:#FF0002;border:2px dotted black;padding:7px;}\ndiv.sample ul {color:green;}<\/pre>\n

          The above codes are samples to understand the CSS attributes and functionalities implemented with the div tag. We will discuss some basic examples in the below sections.<\/p>\n

          Examples of?HTML Block Elements<\/h3>\n

          Given below are the following examples:<\/p>\n

          Example #1<\/h4>\n

          Code:<\/strong><\/p>\n

          \n\n