{"id":195116,"date":"2015-02-04T14:37:38","date_gmt":"2015-02-04T21:37:38","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=195116"},"modified":"2015-03-26T15:28:22","modified_gmt":"2015-03-26T22:28:22","slug":"blank","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/selectors\/b\/blank\/","title":{"rendered":":blank"},"content":{"rendered":"
The And it will also select these paragraphs, which At the time of this writing, See the Pen :blank and :-moz-only-whitespace<\/a> by mariemosley (@mariemosley<\/a>) on CodePen<\/a>.<\/p>\n 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. p:blank { display: none; } p:blank will select these paragraphs, just like p:empty would: <p><\/p> <p><!– nothing […]<\/p>\n","protected":false},"author":33562,"featured_media":0,"parent":14154,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"page-almanac-single.php","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":""},"tags":[],"acf":[],"jetpack-related-posts":[{"id":14206,"url":"https:\/\/css-tricks.com\/almanac\/selectors\/i\/invalid\/","url_meta":{"origin":195116,"position":0},"title":":invalid","date":"September 6, 2011","format":false,"excerpt":"The :invalid selector allows you to select elements that do not contain valid content, as determined by its type attribute. :invalid is defined in the CSS Selectors Level 3 spec as a \u201cvalidity pseudo-selector\u201d, meaning it is used to style interactive elements based on an evaluation of user input. This\u2026","rel":"","context":"With 13 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":14285,"url":"https:\/\/css-tricks.com\/almanac\/selectors\/v\/valid\/","url_meta":{"origin":195116,"position":1},"title":":valid","date":"September 6, 2011","format":false,"excerpt":"The :valid selector allows you to select elements that contain valid content, as determined by its type attribute. :valid is defined in the CSS Selectors Level 3 spec as a \u201cvalidity pseudo-selector\u201d, meaning it is used to style interactive elements based on an evaluation of user input. This selector has\u2026","rel":"","context":"With 7 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":339498,"url":"https:\/\/css-tricks.com\/almanac\/selectors\/e\/empty\/","url_meta":{"origin":195116,"position":2},"title":":empty","date":"April 27, 2021","format":false,"excerpt":"The CSS :empty pseudo-class selects any element that does not contain children for a given selector. \/* Changes the background color of every empty section element *\/ section:empty { background-color: tomato; } If we were to run that code on a page, the CSS would look for a :blank<\/code> pseudo-class builds upon the
:empty<\/a><\/code> pseudo-class. Like
:empty<\/code>,
:blank<\/code> will select elements that contain nothing at all, or contain only an HTML comment. But,
:blank<\/code> will also select elements that include whitespace, which
:empty<\/code> will not.<\/p>\n
p:blank {\r\n display: none;\r\n}<\/code><\/pre>\n
p:blank<\/code> will select these paragraphs, just like
p:empty<\/code> would:<\/p>\n
<p><\/p>\r\n<p><!-- nothing but a comment--><\/p><\/code><\/pre>\n
p:empty<\/code> would not:<\/p>\n
<p> <\/p>\r\n<p>\r\n\r\n <!--a comment and some whitespace-->\r\n \r\n<\/p><\/code><\/pre>\n
:blank<\/code> is part of the CSS Selectors Level 4 draft, and is not supported by any browser. Mozilla supports its own version of
:blank<\/code> under a different, vendor-prefixed name:
:-moz-only-whitespace<\/a><\/code>. The demo below includes Mozilla’s version, and will only work in Mozilla browsers for now.<\/p>\n
Related<\/h3>\n
\n
More Information<\/h3>\n
\n
Browser Support<\/h3>\n
\n\n
\n Chrome<\/span><\/th>\n Safari<\/span><\/th>\n Firefox<\/span><\/th>\n Opera<\/span><\/th>\n IE<\/span><\/th>\n Android<\/span><\/th>\n iOS<\/span><\/th>\n<\/tr>\n<\/thead>\n\n \n Nope<\/td>\n Nope<\/td>\n As :-moz-only-whitespace<\/td>\n Nope<\/td>\n Nope<\/td>\n Nope<\/td>\n Nope<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"