style.css•2.67 kB
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: #f5f5f5;
color: #333;
line-height: 1.6;
}
.container {
max-width: 600px;
margin: 50px auto;
padding: 20px;
}
h1 {
text-align: center;
margin-bottom: 30px;
color: #2c3e50;
}
.todo-container {
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.input-container {
display: flex;
padding: 15px;
border-bottom: 1px solid #eee;
}
#task-input {
flex: 1;
padding: 10px 15px;
border: 1px solid #ddd;
border-radius: 4px 0 0 4px;
font-size: 16px;
outline: none;
}
#add-task-btn {
padding: 10px 20px;
background-color: #3498db;
color: white;
border: none;
border-radius: 0 4px 4px 0;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s;
}
#add-task-btn:hover {
background-color: #2980b9;
}
.filter-container {
display: flex;
justify-content: center;
padding: 15px;
border-bottom: 1px solid #eee;
}
.filter-btn {
margin: 0 5px;
padding: 8px 15px;
background-color: transparent;
border: 1px solid #ddd;
border-radius: 4px;
cursor: pointer;
transition: all 0.3s;
}
.filter-btn.active {
background-color: #3498db;
color: white;
border-color: #3498db;
}
#todo-list {
list-style: none;
max-height: 400px;
overflow-y: auto;
}
.todo-item {
display: flex;
align-items: center;
padding: 15px;
border-bottom: 1px solid #eee;
transition: background-color 0.3s;
}
.todo-item:hover {
background-color: #f9f9f9;
}
.todo-item.completed {
opacity: 0.6;
}
.todo-checkbox {
margin-right: 15px;
width: 20px;
height: 20px;
cursor: pointer;
}
.todo-text {
flex: 1;
font-size: 16px;
}
.todo-item.completed .todo-text {
text-decoration: line-through;
color: #888;
}
.delete-btn {
background-color: #e74c3c;
color: white;
border: none;
border-radius: 4px;
padding: 5px 10px;
cursor: pointer;
transition: background-color 0.3s;
}
.delete-btn:hover {
background-color: #c0392b;
}
.todo-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
border-top: 1px solid #eee;
font-size: 14px;
}
#items-left {
color: #7f8c8d;
}
#clear-completed {
background-color: transparent;
border: none;
color: #7f8c8d;
cursor: pointer;
transition: color 0.3s;
}
#clear-completed:hover {
color: #e74c3c;
}