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!

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


is this correct

is this correct to give body property of overflow:hidden or it may cause any type of problem

your body element is usually and should be 100% of the browsers width and height so overflow: hidden isn't needed.

2 Answers

body{ margin: 0; width:100%; text-wrap:normal; }

nav{ padding-top: 5px; width: 100%; height: 60px; /* when no height is given the #222 background has nowhere to show ;)*/ background-color: #222; position: relative; }

.logo{ float: left; width: 100px; height: 50px; margin-left:5px; }

.logo img { display: block; }

#menu{ float: right; }

#menu li{ display: inline-block; list-style: none; margin: 0 10px; }

you might also want to put a div with the class="wrapper" around your nav bar an stile it like this ;

.wrapper { width: 80%; margin: 0 auto }

just so you get a little space from the border of the browser. you can then resuse this class when ever you want to get that same fx ;)

Steven Parker
Steven Parker
225,770 Points

If you set overflow:hidden on your body element, it will prevent scrollbars from appearing if anything on the page should be too large for the browser window. This may create an inconvenience for the user who would like to scroll over to see the rest of the content.

I'd assume you would only use it if you are sure that's really what you want to happen. I can't think of any other reason to use it.

can u helpo me here http://codepen.io/mehra_as/pen/gPoGwz because when i set overflow property to body it work properly please help me to solve out this problem