css3练习

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Ribbon实现</title>
<style>
/*以下样式只在chrome下最新版本做测试,未做兼容性处理*/
*{ margin:0; padding:0;}
body{ background:#f4f4f4; font:12px/1.6 Georgia, "Times New Roman", Times, serif; color:#999; padding:20px 100px;}/*h2标签中3字下垂字体设置*/
.bubble{ margin:5px auto; width:350px; border-radius:10px; box-shadow:0px 0px 8px rgba(0,0,0,0.3); position:relative; z-index:90;}
.rectangle{ background:#7f9db9; height:50px; width:380px; box-shadow:0px 0px 4px rgba(0,0,0,0.55); z-index:100; position:relative; left:-15px; top:30px;}
.rectangle h2{ line-height:50px; font-size:30px; color:#fff; text-shadow:1px 1px 2px rgba(0,0,0,0.2); text-align:center;}
.bubble:after{ content:''; border:15px solid #7d90a3; border-color:transparent #7d90a3 transparent transparent; height:0; width:0; position:absolute; left:-30px; top:65px; z-index:-1;}
.bubble:before{ content:''; border:15px solid #7d90a3; border-color:transparent transparent transparent #7d90a3; height:0; width:0; position:absolute; right:-30px; top:65px;}
/*对内容中的字体做修饰*/
.info{ padding:60px 25px 35px 25px;}
.info h2{ font-size:20px;}
.info p{ padding-top:10px; font-size:14px; line-height:22px;}
.info p a{ color:#C63; text-decoration:none;}
.info p a:hover{ text-decoration:underline;}
</style>
</head>

<body>
<div class="bubble">
	<div class="rectangle">
    	<h2>3D CSS3 Ribbon</h2>
    </div>
    <div class="info">
    	<h2>I have used only css,friends!</h2>
        <p>For this tutorial,I have used some new properties.You can realize a nice 3D effect using only css.</p>
        <p><a href="#">Go to the tutorial!</a></p>
    </div>
</div>
</body>
</html>

 

效果贴下代码在chrome最新的浏览器中运行下就可以看到了

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值