English 中文(简体)
CSS - 是否有共同选择者?
原标题:CSS - is there a cousin selector?

The Suppose I have the following table (JS Fiddle):

<table class="data-table">
<thead>
    <tr>
        <th scope="col">Method</th>
        <th scope="col">Price</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>Pickup*</td>
        <td>no charge</td>
    </tr>
    <tr>
        <td>Campus mail</td>
        <td>no charge</td>
    </tr>
</tbody>
<tfoot>
    <tr>
        <td colspan="2">* At 1st floor desk</td>
    </tr>
</tfoot>
</table>

TBODY的浏览器已经用一个:nth-child(2n)的挑选器脱掉。 但是,西北大西洋渔业组织的增长背景却不见这些风格,并且打破了每当桌旁有甚至几行时的隔夜。

我愿选择TFOOT的行文,用。 <条码>+选择器是指具有单一母体成分的相邻切合元素。 这里的两条手工艺品都是有色的兄弟姐妹,它们有共同之处。

I could use jQuery ( Something such as $ (......data-table tone tr:nth-child(2n):last-child”).0000ext(.find(“tr”).cs({“background-color”:“blue”})). 但是,如果存在这种解决办法,我更喜欢一个特别安全的解决办法。

因此,是否有办法选择共同要素?

最佳回答

萨赫勒抗旱委在OMA(尽管选择器经过后处理)下工作,因此,你可以浏览一个元素树,然后回落到一个元素表上。 你们要么只能以同样水平的内容(只有向前推进)运作,要么倒闭。

你们不得不放弃你们的 j。

问题回答

Reference: http://www.w3.org/TR/2009/PR-css3-selectors-20091215/#selectors

无,只有假肢和有限的兄弟姐妹选择。 你们必须使用java字母确定该要素。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...