CSS初识

  1. <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title></title>
    		<style>
    			.d1{width: 380px;height:300px;border: 1px solid gainsboro;margin:90px;}
    			h2{font-weight:bolder;margin-left:20px ;}
    			hr{color:darkgrey;margin: 10px;}
    			.t1 tr{font-size: 14px;}
    			.t1 td{border-bottom: 1px dashed grey;padding-left:15px;}
    			.t1{width:300px;height: 200px;margin: 20px;}
    			a{text-decoration: none;}
    			a:link{color: black;}
    			a:hover{text-decoration: underline;color: black;}
    		</style>
    	</head>
    	<body>
    		<div class="d1">
    			<h2>最新文章/New Articles</h2>
    			<hr>
    			<table class="t1">
    				<tr><td><a href="#">中华人民共和国</a></td></tr>
    				<tr><td><a href="#">中央人民政府</a></td></tr>
    				<tr><td><a href="#">西安英莱特信息</a></td></tr>
    				<tr><td><a href="#">学习.NET技术</a></td></tr>
    				<tr><td><a href="#">Python大数据</a></td></tr>
    			</table>
    		</div>
    	</body>
    </html>
  2. <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title>仿真导航栏</title>
    		<style>
    			*{
    			 padding: 0px;
    			 margin: 0px;
    		    }
    		   .d1{border-top:2px  solid red;
    		    	border-bottom:1px solid grey ;
    		    	background-color:#fcfcfc;
    		    	text-align:center;
    		    	}  
    		    .d1 a{text-decoration: none;
    		    		display: inline-block;
    		    		margin-left:15px;
    		    		height: 40px;
    		    		width: 80px;
    		    		font-size:small;
    		    		line-height: 40px;
    		    		}
    		    .d1 a:hover{background-color:gainsboro;}
    		</style>
    	</head>
    	<body>
    		<div class="d1">
    			<a>设为首页</a>
    			<a>手机新浪网</a>
    			<a>移动客户端</a>
    			<a>登陆</a>
    			<a>微博</a>
    		</div>
    	</body>
    </html>
    

     

  3. <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title>网站导航栏</title>
    		<style>
    		   *{
    			 padding: 0px;
    			 margin: 0px;
    		    }
    		   /*.d1{border-top:2px  solid red;
    		    	border-bottom:1px solid grey ;
    		    	background-color: honeydew;}  */
    		    	
    		    span{margin-left:230px;}
    		    .d1 a{display: inline-block;/*a是行内元素所以要转换*/
    		   			width: 120px;
    		   			height: 50px;
    		    	  text-decoration: none;
    		          background-image: url(img/bg.png);
    		          color:white;
    		          text-align: center;
    		         line-height: 50px;/*行高等与盒子的高相等则垂直居中*/
    		          }
    		    a:hover{background-image: url(img/bgc.png);}
    		</style>
    	</head>
    	<body>
    		<div class="d1">
    			<span></span>
    			<a href="#">网站导航</a>
    			<a href="#">网站导航</a>
    			<a href="#">网站导航</a>
    			<a href="#">网站导航</a>
    			<a href="#">网站导航</a>
    			<a href="#">网站导航</a>
    		</div>
    	</body>
    </html>

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值