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.

Design

Jude McLean
Jude McLean
1,286 Points

Responsive Web Design Header Centralised on Mobile Site

I've come to stage 8 of the web design tutorial...and have applied the following code to the header of the responsive.css:

nav {
  background: none;
  float: right;
  font-size: 1.125em;
  margin-right: 5%;
  text-align: right;
  width: 45%;
  }

However, when I minimize the browser the header/menu doesn't centralise as shown in the video tutorial. If anyone is willing to point out a possible error or solution that would be appreciated.

Thanks in advance

Andres Aguero
Andres Aguero
30,545 Points

try setting the display property to block like this

nav { width:45%; display:block; margin: 0 auto; background: none;}