0

why there is a little gap between navbar and header when i make navbar display: inline-block; and how can i remove this gap? please check the code here...

nav {
  display: inline-block;
  width: 100%;
  height: 25px;
  border: 1px solid red;
}

header {
  display: inline-block;
  width: 100%;
  height: 600px;
  border: 1px solid green;
}
<nav></nav>
<header></header>
Temani Afif
  • 245,468
  • 26
  • 309
  • 415
  • Can you make both the element display:block and check; – Silu K Jun 26 '18 at 08:52
  • 1
    @SiluK we don't even need to make them block ... we simply need to remove the inline block and they are by default block and widith:100% and no whitespace – Temani Afif Jun 26 '18 at 08:55
  • Inline-block actually gives you space. Unfortunately, you can't solve this. Try giving block instead. and style accordingly. – Akash Pinnaka Jun 26 '18 at 09:31

0 Answers0