Skip to content

Instantly share code, notes, and snippets.

@joholo
Created December 14, 2012 14:45
Show Gist options
  • Save joholo/4285929 to your computer and use it in GitHub Desktop.
Save joholo/4285929 to your computer and use it in GitHub Desktop.
Hide empty divs - To hide the div set: display: none; in :empty selector
/**
* Hide empty divs - To hide the div set: display: none; in :empty selector
*/
div {
width: 100px;
border: 1px solid blue;
margin: 5px;
min-height: 10px;
}
div:empty {
/* To hide the div set: display: none; */
border: 1px solid red;
}
<!-- content to be placed inside <body>…</body> -->
<div>Content</div>
<div></div>
<div><span>span content</span></div>
<div><span></span></div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment