Describing the layout of my website is a bit tricky, but I'll give it a shot. I have a left navigation bar and a container that spans the rest of the page in a single line. The navigation bar has a width of 88px, and the .right-column-wrapper
takes up the remaining space at 100%. Inside the .right-column-wrapper
, there are two columns side by side, each occupying 50% of the space. However, when I apply position: fixed
to the .right-column
, it doesn't take up 50% of the .right-column-wrapper
as expected, instead taking up half of the browser width.
HTML Code:
<div class="page-wrapper">
<!-- Left side navigation -->
<div class="nav-bar-left">
<a href="" class="w-nav-brand">
<img src="https://i.imgur.com/0f8pGKD.png" alt="">
</a>
<nav role="navigation" class="nav-menu-left">
<a href="who.html" class="nav-link active">who</a>
<a href="what.html" class="nav-link">what</a>
<a href="why.html" class="nav-link">why</a>
<a href="contact.html" class="nav-link">contact</a>
</nav>
<div class="nav-left-social-icons">
<a href="https://twitter.com" target="_blank" class="social-icon-link">
<img src="https://assets.website-files.com/5b17159f88941cfc367e81a3/5b1715a088941c0f047e81f3_twitter-icon.svg" alt="">
</a>
<a href="https://twitter.com" target="_blank" class="social-icon-link">
<img src="https://assets.website-files.com/5b17159f88941cfc367e81a3/5b1715a088941c314a7e81d9_instagram-icon.svg" alt="">
</a>
<a href="https://twitter.com" target="_blank" class="social-icon-link">
<img src="https://assets.website-files.com/5b17159f88941cfc367e81a3/5b1715a088941c861b7e82d0_facebook-icon.svg" alt="">
</a>
</div>
</div>
<!-- Right components -->
<div class="right-column-wrapper">
<div class="column left-column">
<div class="left-column-top">
...
CS code:
.page-wrapper {
width: 100%;
height: 100%;
display: flex;
}
...