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 Framework Basics Build a Website with Bootstrap Building the Navbar

isn't <a> an inline element? why can you set the width and height to it?

<!--Navbar --> <div class="navbar navbar-default navbar-fixed-top"> <div class="container"> <a class="main-logo pull-left" href="#">Ribbit</a> <p class="navbar-text pull-right hidden-xs">A Treehouse Project</p> </div> </div><!-- End navbar -->


.main-logo { display: inline; width: 124px; height: 34px; margin-top: 22px;

}

2 Answers

Sean T. Unwin
Sean T. Unwin
28,690 Points

It's because the element is also floated (with pull-left). This makes elements behave like inline-block displays.

got it, thanks!

Abdulwahab Alansari
Abdulwahab Alansari
15,151 Points

You can set the width and the height but they won't take effect unless you set the value of the display property to inline-block, maybe the pull-left class has the display property set to inline-block.