I am trying to create header inside the header it has two box 1, 2. Inside box 1 it has two other box A1, A2. Don’t know why but I can not set the length container full length of screen even though I set the width for it is 100% it still take 85% screen.
.Header-Fixed {
position: sticky;
z-index: 998;
background-color: #FFFFFF;
outline-style: solid;
padding: 4em;
outline-color: #E5E0FF;
outline-width: 0.5px;
width: 100%;
}
.container {
width: 100%;
padding: 1em;
outline-style: solid;
outline-color: green;
align-items: center;
}
<header>
<div className='Header-Fixed'>
<div className='container'>
</div>
</div>
</header>
Could you show me why this happens? I am beginner with Front End.
2
Answers
Try setting padding on the
.container
box instead of the.Header-Fixed
box like this:Also, if there is padding on any other parent elements (like
<body>
, etc.), that could be preventing it from taking up 100% of the screen width.