2017-07-30 30 views
2

在此应用的边界半径的按钮,该按钮的背景颜色变化:如何在改变边框半径的同时保持HTML <button>的背景颜色?

button{ 
 
    height:200px; 
 
    width:500px; 
 
    /*border-radius:10px; */ 
 
}
<html> 
 
    <button>My Button</button> 
 
</html>

要这样:

button{ 
 
    height:200px; 
 
    width:500px; 
 
    border-radius:10px; 
 
}
<html> 
 
    <button>My Button</button> 
 
</html>

我怎样才能让背景颜色保持一个改变边界半径或边界颜色。

回答

2

background设置为linear-gradient

button{ 
 
    height:200px; 
 
    width:500px; 
 
    border-radius:10px; 
 
    background:linear-gradient(white, #e0e0e0); 
 
}
<html> 
 
    <button>My Button</button> 
 
</html>

相关问题