
The pros of this approach is that it works with replaced elements as well, the cons is that it requires extra markup and JavaScript.Ĭredits: Thanks to Christian Heilmann for helping me debug why SVG masks for HTML elements weren’t originally working for me. Edit: Turns out Paul Rouget did something similar before me, back in August 2010.You need to set the reflection’s background for every element and every element needs an id to use it (but this could be done automatically via script).


support for Firefox / -webkit-border-radius: 10px / support for webkit. (I haven’t tested it, so I am not sure) css. If you want to proceed, here is link to a github repository.
Firefox css webkit password#
I don’t recommend this, since anyone can copy-paste the password to text editor and see it. If we want the reflection to have a little distance from the element (for example 10px like the demo), we also apply a transform of translateY(10px) As you may have already figured out, CSS (and HTML and JavaScript) is a moving. Note:- If you dont want password as input type, the only way I could think of is to use ‘disc’ like font, for the input.Reflections are flipped, so we flip it vertically, by applying transform: scaleY(‑1).
Firefox css webkit how to#

And all these are actually standards, so eventually, this will work in all browsers, unlike -webkit-box-reflect, which was never accepted by the CSS WG.įirst and foremost, have a look at the demo: However, you can create just as flexible reflections in Firefox as well, by utilizing -moz-element(), some CSS3 and Firefox’s capability to apply SVG effects to HTML elements. We all know about the proprietary (and imho, horrible) -webkit-box-reflect.
