user3024194
user3024194

Reputation: 539

Need to overlap divs

I have a website setup using bootstrap and have the navbar done to my liking. Now I have to work on my container. I wanted something like this image here (http://awesomescreenshot.com/0d61zypfff). The main container overlaps the navbar a little bit. I have used these classes for my navbar and have laid out what I think would be the ideal layout of the code..

<div class="navbar navbar-inverse navbar-static-top" role="navigation"></div>
<div class="container"> //Please do not add any styling to the container
    <div class="index"> //background: #ffffff;
        This text overlaps the menubar
    </div>
</div>

I have added extra padding-bottom to the navbar to make the navbar a little more "buff" and want my index section to overlap it. Please let me know if I need to add more information.

Upvotes: 0

Views: 60

Answers (2)

nahtnam
nahtnam

Reputation: 2689

To add onto @isherwood, you must also set the z-index: -1;. This will make it so that the index div will overlap the navbar.

Upvotes: 2

isherwood
isherwood

Reputation: 61056

A little negative margin should do it:

navbar {margin-bottom: -20px;}

Or:

.index {margin-top: -20px;}

Upvotes: 2

Related Questions