gatsby-image renders images on top of a fixed navbar
See original GitHub issueSummary
gatsby-image
renders images on top of a fixed navbar when scrolling down the page. When using ordinary html <img>
, this issue does not occur.
For troubleshooting, I’ve set the z-index of the navbar to 1000, but this does not solve the issue.
You can check the actual behavior by visiting the live test site. Note that the “Services” section uses gatsby-images
and the “About” section uses ordinary html img
, so you can see the difference.
For testing and having a look at the actual code, you can clone the repository here.
Environment
System:
OS: Linux 4.19 Debian GNU/Linux 9 (stretch) 9 (stretch)
CPU: (4) x64 Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
Shell: 4.4.12 - /bin/bash
Binaries:
Node: 10.17.0 - /usr/bin/node
npm: 6.11.3 - /usr/bin/npm
Languages:
Python: 2.7.13 - /usr/bin/python
Browsers:
Firefox: 71.0
npmPackages:
gatsby: ^2.18.12 => 2.18.12
gatsby-background-image: ^0.9.12 => 0.9.12
gatsby-image: ^2.2.37 => 2.2.37
gatsby-plugin-react-helmet: ^3.1.18 => 3.1.18
gatsby-plugin-sharp: ^2.3.10 => 2.3.10
gatsby-source-filesystem: ^2.1.43 => 2.1.43
gatsby-transformer-sharp: ^2.3.9 => 2.3.9
npmGlobalPackages:
gatsby-cli: 2.8.16
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Creating responsive navbars with background images in ...
The way I decided to implement it was simple, first create an absolute positioned container to display the image and then a second...
Read more >Gatsby Image plugin
The Gatsby Image plugin includes two components to display responsive images on your site. One is used for static and the other for...
Read more >All The Dumb Mistakes I Made Building My First Gatsby Site
Gatsby is great, but there's a lot to learn about in the Gatsby ecosystem. Check out mistakes to avoid when building your first...
Read more >StaticImage not showing up in test render in Gatsby
import React from 'react'; import { StaticImage } from 'gatsby-plugin-image'; import Test from '../Test/Test'; const NavBar: React.
Read more >The top choices for React lazy loading libraries in 2021
Below are some of the benefits of gatsby-image in your React application: It can be optimized for images with fixed height and width;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you add
z-index: 10
to yourBackgroundImage
in theheader
component you fix the issue: https://github.com/cheomanigua/gatsby-issue/blob/master/src/components/header.js#L21@cheomanigua Got it, thanks!