久久久久久久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?)
主站蜘蛛池模板: 国产色站| 丰满少妇高潮在线观看 | 国产欧美一区二区精品忘忧草 | 欧美精品在线免费观看 | 中文字幕第一区综合 | 香蕉视频一区二区 | 日韩在线看片 | 国产精品视频网 | 四虎成人影视 | 中文字幕在线观看一区二区三区 | 国产成人a亚洲精品 | 怡红院久久 | 福利小视频在线观看 | 久久私人影院 | 久久免费网 | 国产综合久久 | a√天堂在线| 免费在线观看www | 国产精品高潮呻吟久久 | 亚洲iv一区二区三区 | 国产乡下妇女三片 | 91国内在线 | 欧美视频一区二区三区 | 日本在线一区二区三区 | 免费看毛片网站 | 欧美日韩黄色片 | av基地网| 国产一级特黄aaa大片 | 欧美国产一区二区 | 欧美日韩 | 欧美成人一区二区三区片免费 | 成人免费看片视频 | 亚洲欧美专区 | 亚洲一区网站 | 免费一级全黄少妇性色生活片 | 日韩在线免费视频 | 国产精品无遮挡 | 中文字幕视频一区 | 91蝌蚪少妇偷拍 | 欧美一区二区三区在线播放 | 九九久久精品视频 |