Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.