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 trialXiaodan Lu
4,651 PointsI 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?
3 Answers
rvandaalen
24,090 PointsA 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
21,239 PointsAlternatively you could float the header and your logo
Xiaodan Lu
4,651 PointsThank you everyone for the help! :)
Erik Nuber
20,629 PointsIf 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;
}
sizwengubane
15,244 Pointssizwengubane
15,244 PointsPlease explain in more details, and what do u mean logo