Currently, I'm deep into my CSS learning journey on Progate.com. I've been cruising through the exercises, but I hit a roadblock when it comes to a specific class selector in the CSS code. The task at hand is simple: I need to tweak the CSS so that only the <li>
elements within the header-list are horizontally aligned.
body {
font-family: "Avenir Next";
}
.header-list li {
list-style: none;
float: left;
padding: 33px 20px;
}
.header {
background-color: #26d0c9;
color: #fff;
height: 90px;
}
.header-logo {
float: left;
font-size: 36px;
padding: 20px 40px;
}
.header-list {
float: left;
}
.main {
background-color: #bdf7f1;
height: 600px;
}
.footer {
background-color: #ceccf3;
height: 270px;
}
Although the changes I made produced the desired outcome on the layout, when I tried to submit my answer, a popup appeared with the message:
The CSS for the float property of
<li>
elements should be deleted.
Confused by this, I revisited the instructions and realized that I needed to:
float: left;
padding: 33px 20px;
Hence, I modified the code once again, moving some CSS properties around to comply with this requirement. I found it puzzling why it was necessary to make these changes:
body {
font-family: "Avenir Next";
}
.header-list li {
list-style: none;
/* CSS properties from here are moved to line 32. But why?
We still get the required result without doing so.
*/
}
.header {
background-color: #26d0c9;
color: #fff;
height: 90px;
}
.header-logo {
float: left;
font-size: 36px;
padding: 20px 40px;
}
.header-list {
float: left;
}
.header-list li {
float: left;
padding: 33px 20px;
}
.main {
background-color: #bdf7f1;
height: 600px;
}
.footer {
background-color: #ceccf3;
height: 270px;
}
Feeling a bit lost, I turned to the online community for insights. As a beginner, clearing these small concepts can be quite challenging. Any help or hints would be greatly appreciated. Stackoverflow, here I come!