使 div 元素看上去像一个按钮:浏览器支持所有主流浏览器都不支持 appearance 属性。Firefox 支持替代的 -moz-appearance 属性。Safari 和 Chrome 支持替代的 -webkit-appearance 属性。appearance 属性允许您使元素看上去像标准的用户界面元素。
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>伪装的按钮</title>
<style type="text/css">
div, a, input[type=text] {
-webkit-appearance:button;
-moz-appearance:button;
appearance:button;
}
#nav {
width:240px;
padding:10px;
height:130px;
font-size:14px;
}
#nav a {
font-size:12px;
padding:0 10px;
line-height:22px;
text-decoration:none;
color:#00F;
}
</style>
</head>
<body>
<div id="nav">
<input type="text" name="key" value="关键词">
<a href="#">搜索</a><br>
热门关键词:<br>
<a href="#">CSS3</a><a href="#">HTML5</a><a href="#">移动开发</a></div>
</body>
</html>
转载请注明原文地址:https://ipadbbs.8miu.com/read-42207.html