久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

IE8 的第一個孩子和最后一個孩子

first-child and last-child with IE8(IE8 的第一個孩子和最后一個孩子)
本文介紹了IE8 的第一個孩子和最后一個孩子的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一些 css 用于調整我的表格中的東西.

I have some css for adjusting things in my table.

這里是:

.editor td:first-child
{
    width: 150px; 
}

.editor td:last-child input,
.editor td:last-child textarea
{
    width: 500px;
    padding: 3px 5px 5px 5px;
    border: 1px solid #CCC; 
}

它適用于 Firefox、Safari 和 Chrome,但不適用于(目前)IE8.

It works with Firefox, Safari and Chrome but not (at this time) with IE8.

我知道問題來自第一個孩子和最后一個孩子,但我不是專家.

I know the problem comes from the first-child and last-child but I'm not an expert.

知道如何解決嗎?

PS:我在我的 html 文檔頂部添加了 <!doctype html> 但沒有任何改變.

PS: I added <!doctype html> on top of my html document but nothing changed.

推薦答案

如果你的表只有 2 列,你可以很容易地使用相鄰的兄弟選擇器到達第二個 td,IE8 確實支持連同 :first-child:

If your table is only 2 columns across, you can easily reach the second td with the adjacent sibling selector, which IE8 does support along with :first-child:

.editor td:first-child
{
    width: 150px; 
}

.editor td:first-child + td input,
.editor td:first-child + td textarea
{
    width: 500px;
    padding: 3px 5px 5px 5px;
    border: 1px solid #CCC; 
}

否則,您將不得不使用像 jQuery 這樣的 JS 選擇器庫,或者手動將類添加到最后一個 td,James Allardice 建議.

Otherwise, you'll have to use a JS selector library like jQuery, or manually add a class to the last td, as suggested by James Allardice.

這篇關于IE8 的第一個孩子和最后一個孩子的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

CSS selector when :target empty(:target 為空時的 CSS 選擇器)
Does the CSS direct decendant (gt;) not have any value in selectivity?(CSS 直接后代 (gt;) 在選擇性方面沒有任何價值嗎?)
Using querySelectorAll(). Is the result returned by the method ordered?(使用 querySelectorAll().方法返回的結果是否有序?)
Safari bug :first-child doesn#39;t update display:block when items are removed with JS(Safari 錯誤:當使用 JS 刪除項目時,first-child 不更新 display:block)
nth-Child CSS selectors(nth-子 CSS 選擇器)
Using same ID for multiple HTML tags?(對多個 HTML 標簽使用相同的 ID?)
主站蜘蛛池模板: 欧美精品一二三 | 日韩视频一区 | 国产精品视频免费观看 | 欧美一区二区三区在线免费观看 | 一区二区免费视频 | 日韩在线h | 97av视频| 国产精品不卡一区 | 国产日韩欧美 | 午夜免费 | 日一日操一操 | 免费观看色 | 国产成人网 | 久久国产欧美日韩精品 | 亚洲国产一区二区三区 | 日韩和的一区二区 | 亚洲国产成人精品久久 | 国产sm主人调教女m视频 | 久久久久国产精品午夜一区 | 色性av| 亚洲视频在线观看一区二区三区 | 99精品网 | 粉嫩一区二区三区四区公司1 | 久久久国产精品 | 黄色大片在线播放 | 综合色播 | 久久久久久国产精品 | 亚洲网站在线 | 亚洲日本国产 | 91av久久久| 日本精品视频 | 亚洲欧美成人影院 | 久久一区 | 99精品视频在线观看免费播放 | 久久久久亚洲精品 | av一二三四 | 91久久久久久久 | 国产精品成av人在线视午夜片 | 97起碰| 国产精品一区二区在线 | 国产精品综合一区二区 |