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! While you're at it, check out some resources Treehouse students have shared here.

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

CSS

Aishah Griffin
Aishah Griffin
5,476 Points

Following the directions from the positioning video, and I can not get my h1 inline with the ul.

I'm trying to get my h1 on the same line as the ul. any suggestions?

<header class="main-header">
            <div class="container">
            <h1 class="name">Aishah Griffin</h1>
            <nav class="navigation">
                <ul class="main-nav">
                    <li><a href="index.html">Home</a></li>
                    <li><a href="projects.html"> Projects</a></li>
                    <li><a href="contact.html"> Contact </a></li>
                </ul>
            </nav>
            </div>
        </header>
.name,
.main-nav,
.main-nav li
{
    display: inline;
}
Julian Gutierrez
Julian Gutierrez
19,201 Points

What video are you following if you don't mind me asking? Floating your h1 will put both elements side by side.

Aishah Griffin
Aishah Griffin
5,476 Points

I'm following the "Positioning Elements side by side with inline display" video within the css layout basics.

Aishah Griffin
Aishah Griffin
5,476 Points

Should I float to the left?

Aishah Griffin
Aishah Griffin
5,476 Points

when I change it to this:

.name {
    float: left;
}

.main-nav li {
    float:right;
    display: inline;

}

they're not displayed evenly

1 Answer

Julian Gutierrez
Julian Gutierrez
19,201 Points

Looks like Guil's code doesn't have the nav tag surrounding the unordered list that you included in your code.