Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

christopher walsh
7,272 Pointsmy list is stuck to the left side
I cant figure out why my list is stuck to the left side.
<html>
<head>
<title>My Website</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<nav>
<ul>
<li>Home</li>
<li>Projects</li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
</header>
<div class="mainContent">
</div>
<div class="firstArticle">
</div>
<div class="secondArticle">
</div>
<div class="thirdArticle">
</div>
<div class="moreContent">
</div>
<div class="footer">
</div>
</body>
</html>
- {border: 2px dotted black; padding:5px;}
body {background-color: #6ac1c4; }
header { width: 100%; background-color:#5ca2de; hight:75px; }
li {display:inline-table; padding: 0px 75px; margin: 0px auto;
text-align: center;
} nav { padding: 10px; align-content: center;
}
3 Answers

Sergey Podgornyy
20,660 PointsWhat is align-content
? You need the following code:
nav { padding: 10px; text-align: center;}

jag
18,266 Pointsalign-content is part of the new styles introduced with flex styles.
#main {
border: 1px solid #000000;
display: flex;
flex-wrap: wrap;
align-content:center;
}

jag
18,266 PointsHere is a working version with two columns for nav.

Jake Ford
9,230 PointsI see you have given the li a margin: 0px auto, but maybe you should be targeting the ul as a whole. Try giving the ul some positioning:
ul{
width: 40%;
margin: 0 auto;
}
You have to remember to give it a width for the margin: auto to work.
jag
18,266 Pointsjag
18,266 PointsTypo on head style for "Height" & align-content needs to be used with flex styles.