-1

I have fixed(position property) element called nav-map. I want to set max width to that element.

.nav-map{
   position:fixed;
   left: 0;
   width: 100%;
   top: 0;
   overflow: hidden;
}

but in that case it covers my scrollbar and i want to avoid that.

enter image description here

please, help me solve the issue

full source code: http://codepen.io/borispinus/pen/adpEWa

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252

1 Answers1

0

The problem is that, your scrollbars are part of another div, and it would be nice, if you can bring the div below the fixed nav.

So in the <body> give a padding-top of the height of the fixed nav.

body {
  padding-top: 40px;
}

This is how I do for all the fixed navs. This is how it has been done. :) See how it looks here:

Fiddle: http://codepen.io/anon/pen/QyqBZQ

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252