CSS] Adding margin to the top and not affecting the height of container

slulsedilla

New Member
Because of my navbar, I have to add margin whose height is same as the navbar's height. However, I get a scroll bar when I add margin because the height of body, html, and container is set to 100%. How do I add margin for the navbar, and not get the unnecessary scroll bar? And why doesn't \[code\]margin-bottom: -42px;\[/code\] work?\[code\]body, html { height: 100%;}.navbar { z-index: 10;}.container-fluid { height: 100%; margin-top: 42px; // add margin from the nav bar}\[/code\]
 
Back
Top