css基础--导航栏

【任务一】编码实现如图4所示导航栏效果。要求如下:

  1. 导航栏下边框为10px灰色单实线。
  2. “星着装”的背景图像与其它项目不同。
  3. <!DOCTYPE html>
    <html>
    <head>
    	<meta charset="utf-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
    	<title>导航栏</title>
    	<style type="text/css">
    	.all{
    			width: 1010px;
    			height: 129px;
    			border-bottom: 10px solid silver;
    			margin: 20px auto;		
    		}
    		.a{
    			width: 1010px;
    			height: 344px;
    			background: url(images/head_bg.jpg) repeat-x;
    		}
    		.b{
    			width: 400px;
    			height:350px;
    			position: absolute; /* 绝对定位 */  
    			top: 20;  
    			margin-left:40px ;
    			background: url(images/logo.png) no-repeat;
    		}
    		.c{
    			width: 400px;
    			height:344px;
    			position: absolute; /* 绝对定位 */  
    			top: 20; /* 紧贴.a的顶部 */  
    			left: 430px; /* 距离右边40px */  
    			background: url(images/xuanfu.png) no-repeat;
    		}
    		.d { 
    			color: white; 
    			position: absolute; /* 绝对定位 */  
    			top: 0; 
    			left: 800px; /* 水平居中 */  
    			transform: translateX(-50%); /* 水平居中 */  
    			text-align: center; /* 文字居中 */  
    		}  
    		.d span {  
    			display: inline-block;  
    			width: 90px;  
    			height: 100px;  
    			line-height: 100px; /* 垂直居中文字 */  
    			padding-left: 10px; /* 调整margin */  
    			font-size: 20px; /* 根据需要调整字体大小 */  
    		}  
    			
    		}
    	</style>
    </head>
    <body>
    	<div class="all">
    <div class="a">
    	<div class="b">
    	<div class="c"></div> 
    		</div>
    		<div class="d">
    	<span class="one">穿搭速通</span>
    	<span class="two">时尚大片</span>
    	<span class="three">星着装</span>
    	<span class="four">时尚圈</span>
    	<span class="five">时尚专栏</span>
    	<span class="six">会员/登陆</span>
    	</div>
    </div></div>
    </body>
    </html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值