- This topic is empty.
-
AuthorPosts
-
December 27, 2017 at 12:19 am #264566sushmitgParticipant
Hi,
i am running into problem. basically i have a navbar which is supposed to have 50%-60% of shadow starting from right end which goes 100% when user scrolls.
(there’s a logo on left going past the navbar height and shrinks to fit inside navbar height when page is scrolled)
here’s working example : sushmitg.github.io/sgedgeinspired from this post: https://css-tricks.com/almanac/properties/b/box-shadow/
i tried cloning the effect no. 4 in 3d effect example at the bottom of post.
Now the issue is right now i am accomplishing it by giving the header position of sticky which is not supported in all browsers but if i give position of fixed to it the pseudo element responsible for shadow behind it comes to front (z-index issue).
how to fix it ? the project seems to work fine in chrome only.
December 27, 2017 at 2:36 am #264571Paulie_DMemberA reduced demo in Codepen.io would be helpful rather than a link.
December 27, 2017 at 2:44 am #264573sushmitgParticipantsushmitg.github.io/sgedge
this link is live. later i will move it to custom domain.
i am not using codepen because there’s possibility that inhereted styles might be causing the issue.
still i’ll make codepen if u want.
December 27, 2017 at 3:20 am #264580sushmitgParticipantwell here’s codepen as requested.
December 27, 2017 at 5:12 am #264583Paulie_DMemberSeems to be working in the Codepen….unless I’m missing something.
The shadow is behind the image when the document is scrolled.
December 27, 2017 at 5:54 am #264593sushmitgParticipanti know its working but change the position of header to fixed then the pseudo element casting shadow comes to front.
basically what i want is that the 4th example on this page https://css-tricks.com/almanac/properties/b/box-shadow/
to be a top fixed navbar and when page is scrolled the shadow to be equal to the width of navbar.when position is changed from relative to fixed this is what happeneds
https://codepen.io/sushmitg/pen/ZvLwZJ
this is working with header{ position: sticky } and that too after googling this code “transform-style: preserve-3d;”
and position sticky is obviously not an ideal code for fixed top navbar.
also if you will open the github link in microsoft edge browser, you will notice that the logo is behind the navbar for some reason.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.