JohnGD
1
I am having a small issue with the padding once side is much wider than the other side I will leave a screenshot for reference
and here is my CSS code I am working with and the link to the project I am working with
https://www.freecodecamp.org/learn/responsive-web-design-v9/lab-stylized-to-do-list/build-a-stylized-to-do-list
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 20px;
}
h1 {
text-align: center;
color: #333;
}
.container {
max-width: 400px;
margin-right: auto;
margin-left: auto;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.todo-list li {
margin-bottom: 15px;
line-height: 1.6;
padding: 10px;
background-color: #e5f1e5;
border-radius: 10px;
position: relative;
}
li {
display: list-item;
unicode-bidi: isolate;
}
.todo-list {
list-style-type: none;
}
.sub-item-link {
text-decoration: none;
}
.sub-item-link:visited {
color: purple;
}
.sub-item-link:hover {
color: blue;
}
.sub-item-link:active {
color: red;
}
.sub-item-link:focus {
outline: 2px solid orange;
}
a.sub-item-link {
margin-left: 10px;
text-decoration: none;
}
.sub-item {
list-style-type: square;
}
HI Buddy, In order to make the space equal from both side. We do use one method, which is given below.
padding-left: auto; padding-right: auto;
When you do so then the padding will be equal from both end.
Hope You Understand.
JohnGD
4
Sorry for not including that but here it is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Styled To-Do List</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>My To-Do List</h1>
<ul class="todo-list">
<li>
<input type="checkbox" id="task1">
<label for="task1">Explore gaming keyboards</label>
<ul class="sub-item">
<li>
<a href="#" target="_blank" class="sub-item-link">Store link</a>
</li>
</ul>
</li>
<li>
<input type="checkbox" id="task2">
<label for="task2">Finish the report</label>
<ul class="sub-item">
<li>
<a href="#" target="_blank" class="sub-item-link">Request Access</a>
</li>
</ul>
</li>
<li>
<input type="checkbox" id="task3">
<label for="task3">View Phone's Warranty</label>
<ul class="sub-item">
<li>
<a href="#" target="_blank" class="sub-item-link">View Receipts</a>
</li>
</ul>
</li>
<li>
<input type="checkbox" id="task4">
<label for="task4">Check Processor Specs</label>
<ul class="sub-item">
<li>
<a href="#" target="_blank" class="sub-item-link">View Model Number</a>
</li>
</ul>
</li>
</ul>
</div>
</body>
</html>
JohnGD
5
Hey there thank you for the info but I do have it in my code but for some reason the padding is not right.