zoukankan      html  css  js  c++  java
  • HTML+CSS实现导航条

    此文转载自:https://blog.csdn.net/m0_46374969/article/details/111767998

    HTML+CSS实现导航条:
    在这里插入图片描述
    在这里插入图片描述

    1、HTML部分源代码如下:

    <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="utf-8" />
    		<title>编译遇见未来</title>
          <link rel="stylesheet"  href="css/style.css" >
    	</head>
    	<body>
    		<ul>
    			<li><a href="#">首页</a></li>
    			<li><a href="#">文章</a></li>
    			<li><a href="#">历史回归</a></li>
    			<li><a href="#">收藏</a></li>		
    		</ul>
    	</body>
    </html>
    
    

    2、CSS部分如下:

    *{
    	padding: 0;
    	margin: 0;
    }
    body {
    	background: #000;
    	display: flex;
    	justify-content: center;
    	align-items: center;
    	width: 100vw;
    	height: 100vh;	
    }
    
    ul{
    	width: 60vw;
    	display: flex;
    	justify-content: space-between;
    	align-items: center;
    	
    }
    li{
    	list-style: none;
    	
    }
    a {
    	position: relative;
    	color: #FFF;
    	text-decoration: none;
    	padding: 6px 18px;
    	background-color: #3ce745;
    	transition: background-color 0.8s;
    	
    }
    a:hover{
    	background-color: #E74C3C
    }
    a:before{
    	position: absolute;
    	center:"";
    	width: 20px;
    	height: 20px;
    	border:2xp solid #E74C3C;
    	border-width: 0 0 2px 2px;
    	
    	top:0;
    	right: 0;
    	transition: 0.8s;
    	
    }
    a:before{
    	position: absolute;
    	center:"";
    	width: 20px;
    	height: 20px;
    	border:2xp solid #E74C3C;
    	top:0;
    	right: 0;
    	opacity: 0;
    	transition: 0.2s;
    	
    }
    a:hover::before {
    	left:-12px;
    	bottom:-12px;
    	opacity: 1;
    	
    }
    a:::after before {
    	top:-12px;
    	right: -12px;
    	
    }
    
    
       

    更多内容详见微信公众号:Python测试和开发

    Python测试和开发

  • 相关阅读:
    路面修整
    路由器安置
    高维网络
    SRETAN
    对象、数组 深度复制,支持对象嵌套数组、数组嵌套对象
    仿 window对象 confirm方法
    仿 window对象 alert 方法
    饼状图
    柱状图
    树状图
  • 原文地址:https://www.cnblogs.com/phyger/p/14202905.html
Copyright © 2011-2022 走看看