I've been working on a css ribbon using gradients instead of a border with pseudo elements, but I've come across something I just can't get around. If you get the chance, take a look at this pen I put together, in both Firefox and Chrome browsers. The issue I'm having is with the :after pseudo element. No matter how I adjust the degree of the gradient, or swap out the order of the colors, I can only seem to get it right on one browser or the other. Any suggestions?
Setting :after's gradient at 135deg works for me. (Chrome & Firefox). Can you take a screenshot of what you're looking to achieve? I might be thinking you're aiming for something you're not.
@ChrisP - I think it's just one of those shrug moments really, the code is fine so from what I can see it's a browser bug, unless someone can see something I can't?
While not exactly an ideal fix, maybe an image/svg fallback as a solution?
Thanks @andy_unleash, I was also thinking about possibly applying the same gradient and degree to :before and :after, but then using transform: scaleX(-1) to the :after
It's not a browser bug. Firefox uses the latest syntax, Chrome does not. It's solvable, but you would have to make sure you use the appropriate syntax for each prefix.
I understand I'll have to use different syntax for the prefix's but according to the link, the gradient I have should be working... here's a pen with -45deg
Hi all,
I've been working on a css ribbon using gradients instead of a border with pseudo elements, but I've come across something I just can't get around. If you get the chance, take a look at this pen I put together, in both Firefox and Chrome browsers. The issue I'm having is with the :after pseudo element. No matter how I adjust the degree of the gradient, or swap out the order of the colors, I can only seem to get it right on one browser or the other. Any suggestions?
Setting :after's gradient at 135deg works for me. (Chrome & Firefox). Can you take a screenshot of what you're looking to achieve? I might be thinking you're aiming for something you're not.
135deg doesn't display properly in my Firefox, http://i46.tinypic.com/1on4eo.png
I've tried reordering the colors and rotating the degree (-45 all the way to 315), but nothing seems to do the trick in both browsers
are you using the latest Firefox?
@wolfcry911, yep, 17.0.1
and Windows, for what it's worth
Works on OS X 10.8.2 with FF 17.0.1
@ChrisP - I think it's just one of those shrug moments really, the code is fine so from what I can see it's a browser bug, unless someone can see something I can't?
While not exactly an ideal fix, maybe an image/svg fallback as a solution?
Thanks @andy_unleash, I was also thinking about possibly applying the same gradient and degree to :before and :after, but then using
transform: scaleX(-1)to the :afterIt's not a browser bug. Firefox uses the latest syntax, Chrome does not. It's solvable, but you would have to make sure you use the appropriate syntax for each prefix.
Thanks @joshuanhibbert, but according to https://developer.mozilla.org/en-US/docs/CSS/linear-gradient#Gradient_at_a_45_degree_angle my syntax of
-45deg, darkgreen, green 50%, transparent 50%should do the trick. That works in webkit, not in moz..Unless I'm missing something?
I understand I'll have to use different syntax for the prefix's but according to the link, the gradient I have should be working... here's a pen with -45deg
Very odd indeed. Though it's a tad bit more code, you could just add the -moz- prefix after your
@include, as such:It will do the trick for Firefox, only thing I can think of really.