When the sidebar is set to position: fixed, the icons magically vanish

This CSS is specifically for the side navigation bar.

.side-nav {
  // position: sticky;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  width: calc(3.5vw + 3.5vh);
  // position: fixed;
  &.content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: map-get($background-colors, side-nav);
    &.logo {
      img {
        width: calc(3.5vw + 3.5vh);
        object-fit: cover;
      }
    }
    &.icons {
      // object-fit: cover;
      left: 0;
      bottom: 2.2rem;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      &.github {
        svg {
          height: 4rem !important;
          width: 4rem !important;
          background-color: map-get($icon-bg-colors, github);
          color: map-get($icon-colors, github);
          border-radius: 50%;
          &:hover {
            color: black;
            background-color: white;
          }
        }
      }
      &.linkedin {
        svg {
          height: 4rem !important;
          width: 4rem !important;
          background-color: map-get($icon-bg-colors, linkedin);
          color: map-get($icon-colors, linkedin);
          border-radius: 10%;
          &:hover {
            color: rgb(25, 25, 109);
          }
        }
      }

      &.stackoverflow {
        svg {
          height: 4rem !important;
          width: 4rem !important;
          // color: rgb(235, 152, 0);
          color: map-get($icon-colors, stackoverflow);
          &:hover {
            background-color: white;
          }
          &:active {
            color: red;
          }
        }
      }
      &.twitter {
        svg {
          height: 4rem !important;
          width: 4rem !important;
          // color: rgb(235, 152, 0);
          color: map-get($icon-colors, twitter);
          &:hover {
            background-color: white;
          }
          &:active {
            color: red;
          }
        }
      }
    }
  }
}

If the position is not fixed, this is how it will appear:

https://i.sstatic.net/dt4js.png

Changing only the position:fixed results in the following: https://i.sstatic.net/U1IsE.png

Answer №1

Upon further investigation, it appears that utilizing overflow-x:hidden was causing a conflict with the position:fixed. Previously, I had applied overflow-x:hidden to the body element. Upon removing this, the issue resolved itself.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Place the image in the middle of a div

Struggling to horizontally center an image in a div, but for some reason it's just not working. I've centered images many times before, so why is it different this time? Here's what I've attempted... CSS #cabeca{ position: relative; f ...

Modifying the CSS style of an element on PageA by clicking a button on PageB

For my app, I am incorporating tabs. I want to implement a user button that, when clicked on tab-detail.html, will update the CSS of an element located on its parent tab page, tab.html. .controller('TabCtrl', function($scope,Tabs) { $scope.t ...

Challenges with organizing content using spans in Bootstrap 3

Looking for some help with TB3 here. I've created a jsFiddle to showcase my attempt at building a small minitron, which is essentially a mini jumbotron. https://i.sstatic.net/VxruB.png The idea is to have each 'minitron' contained within a ...

URL for CSS Background-Image

While working on CSS styling for the body, I ran into a problem and was curious to understand the distinction. Initially, I tried this body { background-image: url('img/bg.png'); } However, it did not produce the desired result. http://www ...

Adjust the color of the text as it scrolls by

As I work on developing my website using the Neve Theme on WordPress, I have encountered an issue with customizing the header block. I am using a plugin to set a background color for the header after scrolling 100px down the page, but this makes the text h ...

Switching image sources depending on CSS prefers-color-scheme: A guide

In my endeavor to incorporate the latest CSS prefers-color-scheme media query into my website, I encountered a challenge. I have an img (image) element featuring a very dark blue image, which clashes poorly with the new dark mode setting. Is there a simpl ...

Responsive full-screen background image display

Why is the background image not appearing as a full image on large screens but fitting fine on small screens? <!DOCTYPE html> <html dir="ltr"> <head> <meta charset="utf-8" dir="ltr" /> <title ...

Displaying divs inline with overlapping child divs

As a beginner in CSS, I tackle the challenges of learning it every day. Despite feeling clumsy and not naturally adept at it, my determination is strong (although sometimes my brain feels like an old computer on the verge of overheating). My current goal i ...

What steps should be taken to switch a class from one li element to another and remove it in the process?

As I develop the navigation bar for my website, I am faced with a challenge. I want to create a button-like behavior where clicking on an li element triggers a drop-down section underneath it without using the # attribute to prevent jumping to the top of t ...

What could be causing the issue with absolute positioning not functioning correctly?

I'm having trouble keeping my footer at the bottom of the page: body, html{position:relative;} footer{position:absolute;} Even when I use bottom: 0;, the footer doesn't seem to go all the way to the bottom. Is there anyone who can help me troub ...

Animating content to slide into view in the same direction using CSS transitions

My goal is to smoothly slide one of two 'pages', represented as <divs>, into view with a gentle transition that allows the user to see one page sliding out while the other slides in. Eventually, this transition will be triggered from the ba ...

Using CSS to create shape gradients

I've been attempting to replicate the shape gradient found on Laracasts for hours, but unfortunately, my code isn't displaying anything. Can anyone lend a hand? a{ background: linear-gradient(118deg,#328bf2,#1644ad); border-radius: 54% ...

Dynamic gallery with customizable features (HTML/CSS)

Seeking guidance on creating a seamless html/css gallery without any spacing between each gallery element. All elements are identical in size, housed as list items within a ul inside a div. Media queries have been established to adjust site and image siz ...

Select an HTML element that does not have a class or ID attribute

Is there a way to select and apply styles to a div that is nested within another div without any id or class? <div class="wrapper"> <div> </div> <div> </div> <div> </div> </div> Wh ...

Overflow of dropdown menus in HTML CSS

Hello, I am new to both html and stack overflow. Please forgive me if this question has already been asked, as I couldn't find anything (but maybe I didn't search enough?). I have tried using overflow and clear properties, but I am struggling to ...

JavaScript for Verifying Phone Numbers

After extensive research and tutorials, I am still unable to figure out what is going wrong with my work. I have a button that looks like this: Despite Stack Overflow causing some trouble for me, please ignore the missing class as it is there. This is no ...

php Use cURL and the DOM to extract content with specified CSS styling

Unclear in the title, I want to copy all content from a specific div on an existing webpage (not owned by me). The code successfully extracts the content. Extractor code: // Get Data $curl_handle=curl_init(); curl_setopt($c ...

Event listener is failing to execute the functions

Even though the inline onmouseover="verdadero()" function is properly set up Upon further inspection, it appears that while the event listener is added to the box element, the function is not being triggered when hovering over it, and console.lo ...

Storing the closed state of a pop-up box in localStorage for future reference

I'm struggling to get localStorage working properly on my website (). Here's what I need to achieve: A newsletter subscription pop-up on every page - this part is functioning correctly An option for users to click 'X' to close the po ...

deactivating image mapping on mobile media screens

I'm looking to disable my image map on mobile screens using media queries. I've attempted to include some javascript in the head of my html file, but I encountered an error: <script src="http://code.jquery.com/jquery-1.11.3.min.js"></s ...