“淡化” CSS中的边框 [英] "Fade" borders in CSS

查看:590
本文介绍了“淡化” CSS中的边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在元素上使用 border-left:groove ,但我想要边框淡入到背景中,因为它将要在底部结束。

I'm using border-left: groove on an element but I want the border to "fade" into the background as it's about to end at the bottom.

我希望我有意义。我将如何实现这样的效果?

I hope I'm making sense. How would I achieve something to that effect?

推荐答案

您可以在CSS3的某些情况下为颜色指定渐变,当然边框可以设置为颜色,应该能够使用渐变作为边框颜色。这将包括指定透明颜色的选项,这意味着您应该能够实现您之后的效果。

You can specify gradients for colours in certain circumstances in CSS3, and of course borders can be set to a colour, so you should be able to use a gradient as a border colour. This would include the option of specifying a transparent colour, which means you should be able to achieve the effect you're after.

但是,我从来没有见过它,我不知道当前浏览器支持它是多么的好。您肯定需要接受至少有部分用户看不到。

However, I've never seen it used, and I don't know how well supported it is by current browsers. You'll certainly need to accept that at least some of your users won't be able to see it.

一个快速的google翻了这两个页面,应该可以帮助你在路上:

A quick google turned up these two pages which should help you on your way:

  • CSS3 Gradient Borders
  • http://designshack.co.uk/tutorials/introduction-to-css3-part-2-borders

希望

这篇关于“淡化” CSS中的边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆