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

空白偽類和空偽類的區別

difference between blank and empty pseudo-classes(空白偽類和空偽類的區別)
本文介紹了空白偽類和空偽類的區別的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

:empty 和 :blank(CSS 選擇器級別 4 草案)有什么區別?除了空白目前僅在 Firefox 中有效.

div div{寬度:100 像素;高度:100px;顯示:內聯塊;邊距:5px;}div.emptyCell:empty{背景:#009688;}div.blankCell:空白{背景:#3F51B5;}

<div><div class="emptyCell"><!-- 只是一個注釋--></div><div class="emptyCell"></div><div class="emptyCell"><!-- 只是一個評論--></div><div class="emptyCell"></div></div>

<div class="blankCell"></div><div class="blankCell"><!--不過是評論--></div><div class="blankCell"></div><div class="blankCell"><!--不過是評論--></div></div>

解決方案

:blank 偽類建立在 :empty 偽類之上.喜歡:empty, :blank 將選擇不包含任何內容的元素,或者僅包含 HTML 注釋.但是,:blank 也會選擇元素包括空格, :empty 不會.

css-tricks :blank

另外,來自 W3c 工作草案 4 級選擇器:

<塊引用>

:blank 偽類與 :empty 偽類相同,除了它另外排除 受空格影響的字符判斷元素是否為空時處理 [CSS3TEXT].

例子:

<塊引用>

例如,以下元素匹配 :blank,但不匹配 :empty,因為它至少包含一個換行符,可能還有其他空格:

<p></p>

what is the difference between :empty and :blank (CSS Selectors Level 4 draft) ? Other than the fact that blank only works in Firefox as of now.

div div{
  
  width:100px;
  height:100px;
  display:inline-block;
  margin:5px;
  }
div.emptyCell:empty{
  
  background:#009688;
  
  }
div.blankCell:blank{
  
  background:#3F51B5;
  
  }

<div><div class="emptyCell"><!-- nothing but a comment--></div>
<div class="emptyCell"></div>
<div class="emptyCell"><!-- nothing but a comment--></div>
<div class="emptyCell"></div>
  </div>
<div>
<div class="blankCell"></div>
<div class="blankCell"><!-- nothing but a comment--></div>
<div class="blankCell"></div>
<div class="blankCell"><!-- nothing but a comment--></div>
  </div>

解決方案

The :blank pseudo-class builds upon the :empty pseudo-class. Like :empty, :blank will select elements that contain nothing at all, or contain only an HTML comment. But, :blank will also select elements that include whitespace, which :empty will not.

css-tricks :blank

Also, From the W3c Working Draft on selectors level 4:

The :blank pseudo-class is identical to the :empty pseudo-class, except that it additionally excludes characters affected by whitespace processing [CSS3TEXT] when determining whether an element is empty.

Example:

For example, the following element matches :blank, but not :empty, because it contains at least one linebreak, and possibly other whitespace:

<p> 
</p>

這篇關于空白偽類和空偽類的區別的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Secure random numbers in javascript?(在javascript中保護隨機數?)
Authorization header in img src link(img src 鏈接中的授權標頭)
Sending Authorization Token Bearer through Javascript(通過 Javascript 發送 Authorization Token Bearer)
Do I have to store tokens in cookies or localstorage or session?(我必須將令牌存儲在 cookie 或本地存儲或會話中嗎?)
How to decode jwt token in javascript without using a library?(如何在不使用庫的情況下在 javascript 中解碼 jwt 令牌?)
:hover:before text-decoration none has no effects?(:hover:before text-decoration none 沒有效果?)
主站蜘蛛池模板: 精品乱码一区二区 | 午夜不卡福利视频 | 一区二区在线免费观看 | 国产高潮av | 欧美午夜视频 | 国产 日韩 欧美 在线 | 美国十次成人欧美色导视频 | 男女视频在线看 | 羞羞的视频在线观看 | 日韩波多野结衣 | 亚洲视频中文字幕 | 天堂一区二区三区四区 | 成人av免费在线观看 | 国产情侣久久 | 看av片网站 | 亚洲一区二区在线 | 国产99精品 | 亚洲一区免费视频 | www.蜜桃av| 国产高清一区二区三区 | 粉嫩一区二区三区性色av | 国产精品资源在线 | 国产精品久久久久久久免费大片 | 免费看片在线播放 | 精品日韩一区二区 | 国产免费高清 | 国产日韩精品视频 | 日韩视频中文字幕 | 日本成人免费网站 | 亚洲视频二区 | 日韩一区二区在线播放 | 亚州成人| 欧美日本免费 | 精品一区二区三区在线视频 | 亚洲最大成人综合 | 亚洲精品久久久一区二区三区 | av男人的天堂av| 99久久精品一区二区毛片吞精 | 色综合99 | 日韩精品中文字幕一区二区三区 | 国产美女永久免费无遮挡 |