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

HTML How to Make a Website Styling Web Pages and Navigation Style the Portfolio

I want to put a logo next to my <h1> of the header, what CSS codes should I use?

I want to put a logo next to my <h1> of the header, but I can't put them next to each other, what can I do?

Please explain in more details, and what do u mean logo

3 Answers

A header is initially set to display block, so other elements move to the next line. You should make sure the h1 element is set to display inline, something like this:

h1 { display: inline; }

Hope this helps, otherwise please post the code your using, so people can have a better look at what is going on.

Mark VonGyer
Mark VonGyer
21,239 Points

Alternatively you could float the header and your logo

Thank you everyone for the help! :)

Erik Nuber
Erik Nuber
20,629 Points

If you have something like this,

 <div id="logo">Logo</div>
 <h1> Some title info here </h1>

You could use...

div#logo {
    float: left;
}

h1 {
   float: right;
}

alternatively you could do

div#logo,
h1 {
    display: inline;  
}