CCS按钮实现

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="devgrow.css">
<script type="text/javascript" src="http://www.codefans.net/ajaxjs/jquery-1.6.2.min.js"></script>
<title>CSS3按钮导航Dark Navigation Buttons</title>
<style>
	* { margin: 0; padding: 0; }
	body { background: url(/jscss/demoimg/201206/bg.gif); }
	#content { padding: 40px 20px; font-family: "Helvetica Neue", Helvetica, Arial; font-size: 12px; line-height: 18px; color: #cfdae3; }
	a { text-decoration: none; }
	h2, h3 { margin: 0 0 20px; color: #fff; }
	h2 { font-size: 28px; }
	h3 { font-size: 22px; }
	pre { background: #fff; width: 460px; padding: 10px 20px; border-left: 5px solid #ccc; margin: 0 0 20px; }
	p { width: 500px; font-size: 18px; line-height: 24px; margin: 0 0 30px; }
	input { margin: 0; padding: 0; }
	#header { padding: 10px 20px; display: block; background: #fff; border-bottom: 5px solid #333; height: 40px; }
#logo { width:160px; float: left; }
#logo h1 { width:160px; }
#logo a:hover{background:none;}
#logo a{display:block;font-family:Arial;font-weight:700;height:40px;position:relative;text-transform:uppercase;width:160px;}
#logo a:hover em,#logo a:hover span,#logo a:hover strong{color:#000;}
#logo em{color:#cecece;font-size:53px;font-style:normal;font-weight:400;left:36px;line-height:100px;top:-28px;}
#logo span{color:#aaa;font-size:20px;left:0;top:5px;}
#logo span,#logo em,#logo strong{cursor:pointer;position:absolute;}
#logo strong{color:#888;font-size:33px;left:50px;top:0;}
.return { margin: 3px 0 0; float: right; background: #444; color: #ddd; -moz-border-radius: 25px; -webkit-border-radius: 25px; border-radius: 25px; padding: 8px 15px; display: block; font-family: Arial; font-size: 16px; font-weight: bold; }
.return:hover { background: #000; color: #fff; }
	/* Dark Button CSS */
	.button {
		outline: 0;
		padding: 5px 12px;
		display: block;
		color: #9fa8b0;
		font-weight: bold;
		text-shadow: 1px 1px #1f272b;
		border: 1px solid #1c252b;
		border-radius: 3px;
		-moz-border-radius: 3px;
		-webkit-border-radius: 3px;
		background: #232B30; /* old browsers */
		background: -moz-linear-gradient(top, #3D4850 3%, #313d45 4%, #232B30 100%); /* firefox */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#3D4850), color-stop(4%,#313d45), color-stop(100%,#232B30)); /* webkit */
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3D4850', endColorstr='#232B30',GradientType=0 ); /* ie */
		box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* CSS3 */
		-moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Firefox */
		-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Safari, Chrome */
	}
	.button:hover {
		color: #fff;
		background: #4C5A64; /* old browsers */
		background: -moz-linear-gradient(top, #4C5A64 3%, #404F5A 4%, #2E3940 100%); /* firefox */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#4C5A64), color-stop(4%,#404F5A), color-stop(100%,#2E3940)); /* webkit */
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C5A64', endColorstr='#2E3940',GradientType=0 ); /* ie */
	}
	.button:active {
		background-position: 0 top;
		position: relative;
		top: 1px;
		color: #fff;
		padding: 6px 12px 4px;
		background: #20282D; /* old browsers */
		background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */
		-moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */
		-webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */
		box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */
	}
	
	/* Other stuff: */
	.button-list { list-style: none; padding: 0; margin: 0; width: 100%; float: left; display: block; margin: 0 0 30px; }
	.button-list li { float: left; margin: 0 10px 0 0; }
	.button-list li.search { border-left: 1px solid #273137; padding-left: 18px; margin-left: 10px; position: relative; }
	/* Search CSS: */
	.search-input {
		padding: 0 5px 0 22px;
		border: 1px solid #1c252b;
		height: 30px;
		color: #9fa8b0;
		font-size: 12px;
		line-height: 30px;
		font-weight: bold;
		text-shadow: 1px 1px #1f272b;
		border-radius: 25px;
		-moz-border-radius: 25px;
		-webkit-border-radius: 25px;
		background: #20282D; /* old browsers */
		background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */
		-moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */
		-webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */
		box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */
	}
	.search-input:focus {outline: none;}
	.search-submit {
		width: 13px;
		height: 13px;
		border: none;
		background: url(/jscss/demoimg/201206/mag-glass.png) no-repeat;
		display: block;
		position: absolute;
		left: 26px;
		top: 10px;
		text-indent: -9999em;
	}
	/* Vertical List: */
	.vertical-list {
		list-style: none;
		padding: 10px;
		width: 200px;
		border-radius: 5px;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		background: #20282D; /* old browsers */
		background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */
		-moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */
		-webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */
		box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */
	}
	.vertical-list .button {
		border-radius: 5px;
		-moz-border-radius: 5px;
		-webkit-border-radius: 5px;
		background: #515B62; /* old browsers */
		background: -moz-linear-gradient(top, #515B62 3%, #444E55 5%, #394147 100%); /* firefox */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#515B62), color-stop(5%,#444E55), color-stop(100%,#394147)); /* webkit */
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#515B62', endColorstr='#394147',GradientType=0 ); /* ie */
	}
	.vertical-list .button:hover {
		background: #5F6B72; /* old browsers */
		background: -moz-linear-gradient(top, #5F6B72 3%, #56646C 4%, #4D5A62 50%, #434D54 100%); /* firefox */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#5F6B72), color-stop(4%,#56646C), color-stop(50%,#4D5A62), color-stop(100%,#434D54)); /* webkit */
		filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5F6B72', endColorstr='#434D54',GradientType=0 ); /* ie */
	}
	.vertical-list .button:active {
		padding: 5px 12px;
		top: 0;
		background: #515B62; /* old browsers */
		background: -moz-linear-gradient(top, #515B62 3%, #444E55 5%, #394147 100%); /* firefox */
		background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#515B62), color-stop(5%,#444E55), color-stop(100%,#394147)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#515B62', endColorstr='#394147',GradientType=0 ); /* ie */	-moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */
		-moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Firefox */
		-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Safari, Chrome */
		box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* CSS3 */
	}
	.vertical-list li { margin: 0 0 5px; }
	.vertical-list li:last-child { margin: 0; }
</style>
</head>
<body>
<div id="content">
	<h3>Dark Navigation Buttons</h3>
	<ul class="button-list">
		<li><a href='/' class='button' οnclick="return false;">Home</a></li>
		<li><a href='/' class='button' οnclick="return false;">About</a></li>
		<li><a href='/' class='button' οnclick="return false;">Portfolio</a></li>
		<li><a href='/' class='button' οnclick="return false;">Blog</a></li>
		<li class="search"><input type="text" class="search-input" name="search" value="Search" οnclick="$(this).val('');" /><input type="submit" class="search-submit" /></li>
	</ul>
	<h3>Vertical Menu:</h3>
	<ul class="vertical-list">
		<li><a href='/' class='button' οnclick="return false;">Home</a></li>
		<li><a href='/' class='button' οnclick="return false;">Our Studio</a></li>
		<li><a href='/' class='button' οnclick="return false;">Portfolio</a></li>
		<li><a href='/' class='button' οnclick="return false;">Our Team</a></li>
		<li><a href='/' class='button' οnclick="return false;">Get in Touch</a></li>
	</ul>
</div>
<div style="width:640px;margin:10px auto 20px auto; padding:0 0 0 380px;overflow:hidden">
<!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
</div>
<!-- JiaThis Button END -->
<div style="display: none">
    <script type="text/javascript">
        var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
        document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fadd0db9dee36c7a9b64141788e26de72' type='text/javascript'%3E%3C/script%3E"));
</script>
    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-21395429-1']);
        _gaq.push(['_trackPageview']);
        (function () {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
</script>
</div>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值