網(wǎng)頁設(shè)計中的對象插入規(guī)則

  • 2019-05-14 11:19:44
  • 閱讀次數(shù):
  • 作者:盈嵐科技小編
  • 來源:http://www.iy5y368.cn

1、網(wǎng)站建設(shè)中,如果一個table-cell元素的父元素不是table-row元素,則會在該table-cell 元素及其父元素之間插入一個匿名table-row對象。所插入的這個對象將包含該table-cell元素的所有連續(xù)兄弟,考慮以下樣式和標(biāo)記:

system {display: table;}

name, moons (display: table-cell;}

<systera>

<name>Mercury</name>

<moons>0</moons>

</system>

在單元格元素(table-cell)和system元素之間插入了一個匿名table-row對象,它包含name和moons元素。

即使父元素是table-row-group,這個規(guī)則也同樣成立。擴(kuò)展這個例子,假設(shè)應(yīng)用以下樣式:

system {display: table;}

planet {display: table-row-group;}

name, moons {display: table-cell}

<system>

<planet>

<name>Mercury</name>

<moons>0</moons>

</planet>

<planet>

<name>Venus</name>

<moons>0</moons>

</planet>

</syscem>

在這個例子中,兩組單元格都包含在一個匿名table-row對象中,該對象插入到該組單元格和相應(yīng)Planet元素之間。

2、如果一個table-row元素的父元素不是table、inline-table或table-row-group元素,則會在該table-row元素及其父元素之間插入一個匿名table元素。網(wǎng)站建設(shè)人員插入的這個對象將包含該table-row元素的所有連續(xù)兄弟??紤]以下樣式和標(biāo)記:

docbody{display: block;}

planet {display: table-row;}

<docbody>

<planet>

<narae>Mercury</name>

<moons>0</moons>

</planet>

<planet>

<name>Venus</name>

<moons>0</moons>

</planet>

</docbody>

由于planet元素的父元素的display值為block,所以會在planet元素和docbody元素之間插入匿名table對象。這個對象將包含這兩個planet元素,因為它們是連續(xù)兄弟。

3、如果一個table-column元素的父元素不是table、inline-table或table-column-group元素,則在該table-column元素及其父元素之間插入一個匿名table元素。這與前面討論的table-row元素的相應(yīng)規(guī)則很相似,只不過這里是面向列的。

4、如果一個table-row-group、table-header-group、table-footer-group、table-coliunn-group或tdble-caption元素的父元素不是table元素,則會在該元素及其父元素之間插入一個匿名table元素。

5、如果一個table或inline-table元素的子元素不是table-row-group、table-header-group、table-footer-groyp、table-row或table-caption元素,則在該table元素與其子元素之間插入一個匿名table-row對象。這個匿名對象將包含該子元素的所有不是table-row-group、table-header-group、table- footer-group、table-row或table-caption元素的連續(xù)兄弟,考慮以下樣式和標(biāo)記:

system {display; table;}

planet {display: table-row;}

name, moons {display: table-cell;}

<system>

<planet>

<name>Mercury</nanie>

<moons>0</moons>

</planet>

<name>Venus</name>

<moons>0</moons>

</system>

這里,在system元素和第二組name和moons元素之間插入了一個匿名table-row對象。planet元素未包含在這個匿名對象中,因為其display值為table-row。

6、如果一個table-row-group、table-header-group或table-footer-group元素的子元素不是table-row元素,網(wǎng)站建設(shè)人員則在該元素及其子元素之間插入一個匿名table-row對象。這個匿名對象包含該子元素的所有本身非table-row對象的連續(xù)兄弟??紤]以下樣式和標(biāo)記

system {display: table;}

planet {display: table-row-group;}

name, moons {display: Cable-cell;}

<system>

<planet>

<name>Mercury</name>

<moons>0</moons>

</planet>

<name>Venus</name>

<moons>0</moons>

</system>

在這里,網(wǎng)站建設(shè)的各組name和moons元素都包含在一個匿名table-row元素中。第二組name和moons元素與system之間之所以插入匿名table-row元素,是根據(jù)規(guī)則5完成的。對于第一組,匿名對象插入到planet元素和其子元素之間,因為planet元素是一個table-row-group元素。

7、如果一個table-row元素的子元素不是table-cell元素,則在該元素和其子元素之間插入一個匿名table-cell對象。這個匿名對象包含該子元素的所有本身非table-cell元素的連續(xù)兄弟??紤]以下樣式和標(biāo)記:

system {display: table;}

planet {display: table-row;}

name, moons {display: table-cellj}

<system>

<planet>

<name>Mercury</name〉

<num>0</num>

</planet>

</system>

由于元素num沒有與表有關(guān)的display值,將在planet元素和num元素之間插入一個匿名table-cell對象。

這種行為還會擴(kuò)展到匿名行內(nèi)框。假設(shè)未包含num元素:

<system>

<planet>

<name>Mercury</name>0

</planet>

</system>

0仍將包含在匿名table-cell對象中,為了進(jìn)一步說明這一點,來看一個選自CSS規(guī)范的例子:

example {display: table-cell;}

row {display: table-row;}

h1 {font-weight: 900;}

<example>

<roW>This is the <hi>top</hi> row.</row>

<row>This is the <hi>bottom</hi> row.</row>

</example>

在每個row元素中,文本片段和hi元素都包含在一個匿名table-cell對象中。

當(dāng)前文章標(biāo)題:網(wǎng)頁設(shè)計中的對象插入規(guī)則

當(dāng)前URL:http://www.iy5y368.cn/news/wzzz/objects-inserted-rules.html

上一篇:網(wǎng)頁設(shè)計中的匿名表對象

下一篇:網(wǎng)頁設(shè)計中的表層

網(wǎng)站建設(shè)、網(wǎng)絡(luò)營銷咨詢專線:181-8386-5875(點擊可一鍵撥號)