CSS案例练习

01-表格斑马线

代码:

<html >
 <head>
   
  <title>练习-表格斑马线</title>
  <style type = "text/css">
  td{
	text-align:center;
	width:25%;
  }
  .tr1{
	background:#e8e8e8;
  }
  table{
	border-collapse:collapse;
  }
  tr{
	border-bottom:1px solid #c0c0c0;
  }
  </style>
 </head>
 <body>
   <table width="100%">
	   <tr class="tr0">
			<td>id</td>
			<td>名称</td>
			<td>血量</td>
			<td>伤害</td>
	   </tr>
	   <tr class="tr1">
			<td>1</td>
			<td>gareen</td>
			<td>340</td>
			<td>58</td>
	   </tr class="tr0">
	   <tr>
			<td>2</td>
			<td>teemo</td>
			<td>320</td>
			<td>76</td>
	   </tr>
	   <tr class="tr1">
			<td>3</td>
			<td>annie</td>
			<td>380</td>
			<td>38</td>
	   </tr>
	   <tr class="tr0">
			<td>4</td>
			<td>deadbrother</td>
			<td>400</td>
			<td>90</td>
	   </tr>
   </table>
 </body>
 <script type="text/javascript">
	
   </script>

</html>

效果图:

 02-美人尖

代码:

<html >
 <head>
   
  <title>美人尖</title>
  <style type = "text/css">
	div{
		width:0px;
		height:0px;
		border-left:75px solid blue;
		border-right:75px solid blue;
		border-top:75px solid red;
	}
  </style>
 </head>
 <body>
   <div></div>
 </body>
 <script type="text/javascript">
	
   </script>

</html>

效果图:

03- 短线下划线

代码:

<html >
 <head>
   
  <title>短线下划线</title>
  <style type = "text/css">
  td{
	text-align:center;
  }
  td{
  
	border-bottom:3px solid #33ccff;
  }
  table{
	border-collapse:separate;
  }
  </style>
 </head>
 <body>
   <table width="100%">
		<tr>
			<td>商品</td>
			<td>数量</td>
			<td>价格</td>
			<td>小计</td>
		</tr>
   </table>
 </body>
 <script type="text/javascript">
	
   </script>

</html>

效果:

04- 下拉菜单风格:

代码:

<html >
 <head>
   
  <title>下拉菜单风格</title>
  <style type = "text/css">
  a{
	text-decoration:none;
	color:cornflowerblue;
	cursor:pointer;
  }
  div{
  		width:70px;
		border:1px solid #c0c0c0;
		margin:10px 0px 0px 70px;
  }
  a.id{
	display:block;
	color:#888888;
	padding:10px 0px 10px 15px;
	
  }
  a.id:hover{background-color:#c0c0c0}
  </style>
 </head>
 <body>
   <a href="#">武器</a>
   <a href="#">护甲</a>
   <a href="#">英雄</a>
	<div>
		<a class="id">盖伦</a>
		<a class="id">提莫</a>
		<a class="id">安妮</a>
		<a class="id">死格</a>
	</div>
 </body>
 <script type="text/javascript">
	
   </script>

</html>

效果:

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值