HTML exercises

HTML CSS Exercise: Style the element which is not empty


HTML Code:

<!doctype html>
<title>HTML CSS Exercise - Style the element which is not empty</title>
.container {
  background: #5ac4ed;
  height: 150px;
  width: 200px;

.container:empty {
  background: #ec8007;
<div class="container"><!-- I am empty --></div>
<div class="container">I am not empty</div>

Live Demo:

See the Pen style-the-element-which-is-not-empty-answer by w3resource (@w3resource) on CodePen.

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo

What is the difficulty level of this exercise?

New Content: Composer: Dependency manager for PHP, R Programming

bedava porno