<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.show{
width: 150px;
height: 50px;
text-align: center;
line-height: 50px;
border-right:#222222 20px solid ;
border-bottom:#222222 20px solid ;
border-left:#dddddd 20px solid ;
border-top:#dddddd 20px solid ;
background-color:#cccccc ;
}
</style>
</head>
<body>
<input type="button" value="动态增加立体效果" onclick="change()"> <hr/>
<div id="box">立体效果</div>
</body>
</html>
<script>
function change() {
document.getElementById("box").className="show"; //给box添加show样式
}
</script>