Skip to content

Instantly share code, notes, and snippets.

@dshen6
Last active October 24, 2017 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dshen6/d9cdd70e652a6831d67ff35d89480e89 to your computer and use it in GitHub Desktop.
Save dshen6/d9cdd70e652a6831d67ff35d89480e89 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=d9cdd70e652a6831d67ff35d89480e89

Create a mosaic with different colors by adding ID attributes and selecting individual elements. Use the background-color attribute.

<!DOCTYPE html>
<html>
<head>
<title>Mosaic</title>
</head>
<body>
<p>Create a mosaic with different colors by adding ID attributes and selecting individual elements. </p>
<div>red</div>
<div>orange</div>
<div>yellow</div>
<div>green</div>
<div>blue</div>
<div>#4286f4</div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</body>
</html>
div {
width:100px;
height:100px;
border: 1px solid black;
float:left;
padding: 1px;
text-align:center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment