CSS CSS Layout CSS Layout Techniques Display

Ryan Myers
Ryan Myers
5,322 Points

says that I am not targeting list items inside .main-list?

style.css
/* Complete the challenge by writing CSS below */

header {
  text-align: center;
}
.logo {
  width: 60px;
  margin: auto;
}

ul li, .main-list {
  display: inline-block;
}
index.html
<!DOCTYPE html>
<html>
<head>
    <title>CSS Layout</title>
    <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
</head>
    <body>
    <div class="container">
        <header>
            <img class="logo" src="city-logo.svg" alt="An illustration of a building">
            <ul class="main-list">
                <li><a href="#">Donuts</a></li>
                <li><a href="#">Tea</a></li>
                <li><a href="#">Coffee</a></li>
            </ul>
        </header>
    </div>
    </body>
</html>

2 Answers

Zaid Khan
Zaid Khan
12,739 Points

Hi Ryan Myers

To target list items inside the .main-list, you need to select the parent element first.

Like this:

.main-list li {
  display: inline-block;
}
Minardo Toirac Isla
Minardo Toirac Isla
6,901 Points

Yes, I would write it like Ryan's way. First parent, and child after.