Is it possible to graduate the opacity of an HTML element?

前端 未结 6 1798
误落风尘
误落风尘 2020-12-21 05:54

I want a

element (the whole element, contents and everything) to fade out towards the bottom. It\'s to truncate a news post that has to fit into a v
6条回答
  •  失恋的感觉
    2020-12-21 06:24

    Try this handy tool, it'll generate alpha colours for you, you're basically trying to use an rgba value, but of course gotta be aware that this will only be supported by newer browsers...

    http://www.colorzilla.com/gradient-editor/

    This is what it came up with for a black to 100% alpha gradient: background: url(IMAGE_URL) linear-gradient(to bottom, rgba(0,0,0,1) 0%,rgba(255,255,255,0) 100%);

提交回复
热议问题