Skip to content

Instantly share code, notes, and snippets.

@SabbaKilam
Last active January 27, 2017 14:25
Show Gist options
  • Save SabbaKilam/63d5d869d38531553adbbfbba4f6a6c3 to your computer and use it in GitHub Desktop.
Save SabbaKilam/63d5d869d38531553adbbfbba4f6a6c3 to your computer and use it in GitHub Desktop.
Show Todos
/**
Show Todos
*/
body{
background-color: lightgray;
user-select: none
}
#holder{
position: absolute;
margin: auto;
width: 75%;
height: 50%;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: teal;
border-radius: 0.5rem;
box-shadow: 5px 5px 15px #555;
color: white;
overflow-y: scroll;
}
<!DOCTYPE html>
<html>
<head>
<title>HTML5, CSS3 and JavaScript demo</title>
</head>
<body>
<center>
<div id="holder"></div>
</center>
</body>
</html>
var holder = document.querySelector('#holder');
var todos = [
"Really learn objects",
"Get better at JavaScript",
"Do the laundry",
"Make dinner",
"Massage your feet",
"The last item in the list"
];
function showTodo(todo){
var div = document.createElement('div');
div.innerHTML = todo;
holder.appendChild(div);
}
holder.innerHTML = "";
todos.forEach(showTodo);
{"view":"split-vertical","fontsize":"150","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment