Heim  >  Artikel  >  Web-Frontend  >  Html 标签的嵌套规则_html/css_WEB-ITnose

Html 标签的嵌套规则_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:40:531140Durchsuche

一、HTML 标签包括 块级元素(block)、内嵌元素(inline)

   1、块级元素

  一般用来搭建网站架构、布局、承载内容……它包括以下这些标签:

address、blockquote、center、dir、div、dl、dt、dd、fieldset、form、h1~h6、hr、isindex、menu、noframes、noscript、ol、p、pre、table、ul

      2、内嵌元素

  一般用在网站内容之中的某些细节或部位,用以“强调、区分样式、上标、下标、锚点”等等,下面这些标签都属于内嵌元素:

a、abbr、acronym、b、bdo、big、br、cite、code、dfn、em、font、i、img、input、kbd、label、q、s、samp、select、small、span、strike、strong、sub、sup、textarea、tt、u、var
二、HTML 标签的嵌套规则
        1、 块级元素不能放在

里面:

<p></p><ol><li></ol> ?? 错<p></p><div></div> ?? 错

          

<!--p标签不能嵌套h1 <P>里不能包含块元素,h1是块元素,所以不能--><!--<p align="center">--><!--<h1>专家称普通口罩对防范PM2.5作用微弱</h1>--><!--</p>-->

        2、有几个特殊的块级元素只能包含内嵌元素,不能再包含块级元素,这几个特殊的标签是:      

h1、h2、h3、h4、h5、h6、p、dt
         3、

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn