0
我试图在自定义按钮上实现悬停辉光(请参见下面的图片)。 我在Chrome中玩游戏,无法通过-webkit-radial-gradient获得任何类似的外观。 使用-webkit-radial-gradient进行辉光
<html>
<head>
<style type="text/css">
button {
margin-top: 20px;
width: 100px;
height: 32px;
border-style: solid;
border-width: 1px;
border-radius: 5px 5px 5px 5px;
border-color:#D95D00;
box-shadow: 0 0 4px #F3BB35 inset;
background: -webkit-gradient(linear, left bottom, left top, from(#D95D00), to(#E6A200));
background: -webkit-gradient(linear, left top, left bottom, from(#FFD266), to(#F28430));
background: -webkit-gradient(linear, left bottom left top, from(#E97F2F), to(#F3BB35));
}
button:hover {
background: -webkit-gradient(linear, left bottom, left top, from(#D95D00), to(#E6A200));
background: -webkit-gradient(linear, left top, left bottom, from(#FFD266), to(#F28430));
background-image: -webkit-radial-gradient(center, ellipse cover, #FFFFFF, #000);
}
</style>
</head>
<body>
<button>Hello</button>
</body>
</html>
你想让按钮本身'发光',还是你想要一个边缘发光的边框? – PhonicUK 2012-08-09 14:04:21
让它发光。但似乎所有这些渐变是不好的主意,字体也不光滑。 – Vasya 2012-08-09 14:34:05
如果您因为问题而置身于发光边框,那么您可以使用box-shadow属性。 – PhonicUK 2012-08-09 14:51:30