Here’s a simple HTML structure for a web application similar to Microsoft Sticky Notes, with options to add notes, edit, and save them. Note that this example does not include any backend functionality for persistent storage, and the capabilities are limited to the front-end.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sticky Notes</title>
<style>
body {
display: flex;
flex-wrap: wrap;
background-color: #f0f0f0;
padding: 20px;
}
.note {
background: #ffeb3b;
border: 1px solid #fbc02d;
border-radius: 5px;
padding: 10px;
margin: 10px;
width: 200px;
height: 200px;
position: relative;
}
.note textarea {
width: 100%;
height: 100%;
border: none;
background: transparent;
}
.delete-btn {
background: red;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
position: absolute;
top: 5px;
right: 5px;
}
#addNote {
margin: 10px;
padding: 10px 20px;
background: #4caf50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
</style>
</head>
<body>
<button id="addNote">Add Note</button>
<script>
const addNoteButton = document.getElementById('addNote');
addNoteButton.addEventListener('click', function() {
const note = document.createElement('div');
note.className = 'note';
const textarea = document.createElement('textarea');
textarea.placeholder = 'Write your note here...';
const deleteButton = document.createElement('button');
deleteButton.innerHTML = 'X';
deleteButton.className = 'delete-btn';
deleteButton.addEventListener('click', function() {
note.remove();
});
note.appendChild(textarea);
note.appendChild(deleteButton);
document.body.appendChild(note);
});
</script>
</body>
</html>
Key Features:
- Add new sticky notes with a button.
- Each note has a textarea for text input.
- A delete button for each sticky note to remove it.
Note:
This code creates a simple front-end application without saving notes persistently. For saving notes, you would need to implement backend functionality using a server-side language or use localStorage in JavaScript.