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

CSS 和 Internet Explorer 中的 :last-child 偽類選擇器

:last-child pseudo class selector in CSS and Internet Explorer(CSS 和 Internet Explorer 中的 :last-child 偽類選擇器)
本文介紹了CSS 和 Internet Explorer 中的 :last-child 偽類選擇器的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有以下代碼:

ul.myList li{
     border-right: 1px dotted #000;
}

但是,在最后一個元素上,我需要刪除該邊框,因為我正在使用的設計表明最后一項不需要邊框作為分隔符.

However, on the last element, I need to remove that border as the design that I am working from dictates that the last item does not require a border as a separator.

所以,我需要定位列表的最后一個子元素,因此在我的 CSS 中添加了

So, I need to target the last child of a list and so within my css I have added

ul.myList li:last-child{
     border-right: none;
}

眾所周知,它在 Firefox、Safari 和 Chrome 中運行良好.

Which as we all know, works fine in Firefox, Safari and Chrome.

問題出在我們在 Internet Explorer 6 到 8 中查看頁面時.

The problem lies when we view the page in Internet Explore 6 through to 8.

推薦答案

所以,經(jīng)過一番挖掘,我找到了答案:

So, after some digging around, I found the answer:

如果瀏覽器是 IE<8,請指定如下樣式表:

If the browser is IE<8, specify a stylesheet like this:

<!--[if lt IE 8]>
<link rel="stylesheet" href="css/ie_all.css" type="text/css" />
<![endif]-->

并在您的 IE 樣式表中指定以下規(guī)則:

And within your IE stylesheet specify the following rules:

ul.myList li{
     border-right: expression(this.nextSibling==null?'none':'inherit');
}

nextSibling 表達式查看其后是否有元素,是否繼承默認樣式表中指定的規(guī)則,如果沒有則應用新規(guī)則.

The nextSibling expression looks to see if there is an element after it and if there is inherits the rule specified in the default stylesheet, if not it applys a new rule.

更多信息可以在這里找到

這篇關于CSS 和 Internet Explorer 中的 :last-child 偽類選擇器的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關文檔推薦

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?)
主站蜘蛛池模板: 中文字幕一区二区三区四区五区 | 欧美黄色免费网站 | 国产乱码久久久久久一区二区 | 成人激情视频在线 | 亚洲成人av | 免费一二区 | 亚洲精品黄色 | 天堂中文在线播放 | 91精品成人久久 | 国产精品一区二区免费 | 99re视频在线免费观看 | 国产中文原创 | 国产精品日韩在线观看一区二区 | 日本三级网站在线观看 | 亚洲成人网在线播放 | 青草青草久热精品视频在线观看 | 国产91久久久久蜜臀青青天草二 | 国产精品毛片一区二区在线看 | jizz18国产 | 欧美一区二区三区免费在线观看 | 请别相信他免费喜剧电影在线观看 | 在线播放精品视频 | 国产精品久久久久免费 | 一级毛片免费视频观看 | 在线一区二区三区 | 国产精品美女久久久久久免费 | 国产激情视频在线 | 亚洲精彩视频在线观看 | 中文字幕在线网 | 最新中文字幕一区 | 国产精品一区二区三区免费观看 | 91免费在线| 国产一级片免费看 | 狠狠干综合视频 | 综合久久久 | 国产精品久久久久久久久久久久午夜片 | 国产三区av | 日韩免费电影 | 日韩精品在线网站 | 日韩欧美三区 | 毛片99|