'How to make navbar full width? [duplicate]
I want to make navbar full width of the screen but for some reason, it's full width only on the right side.
Left side of the navbar is not full width. Can someone please tell me how can I do it?
CSS code looks like that:
.head{
background-color:rgb(48, 87, 56);
box-shadow: 1px 1px 10px 3px rgb(155, 153, 153);
margin-top: -2%;
position: fixed;
width:100%;
}
Solution 1:[1]
I'm not sure, I should see your code, but try it : reset your body
*{
margin:0px;
padding:0px;
}
Solution 2:[2]
Maybe this can help:
* {
margin:0;
padding:0;
}
.navbar {
padding: 6px 8px;
display:flex;
justify-content:flex-start;
align-items:center;
background-color:rgb(48, 87, 56);
box-shadow: 1px 1px 10px 3px rgb(155, 153, 153);
position: fixed;
width:100%;
}
.logo {
width:20px;
height:20px;
}
<div class="navbar">
<img alt="" src="https://www.freepnglogos.com/uploads/google-logo-png/google-logo-png-suite-everything-you-need-know-about-google-newest-0.png" class="logo" />
</div>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Arezou Saremian |
| Solution 2 | miftahulrespati |

