HTML과 CSS로 navbar를 만드는 방법.
HTML Codes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Tech Joint is the most popular programming Teams Group for project development">
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="/css/index.css">
<link rel="icon" href="/img/phone_bg-removebg-preview.png">
<title>Responsive webpage </title>
</head>
<body>
<section id="main">
<header>
<p class="logo"><i class='bx bx-meteor'></i>Tech Joint </p>
<nav>
<ul class="nav_links">
<li class="active"><a href="#main">Home</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">About</a></li>
<li><a href="#class">Party</a></li>
</ul>
</nav>
<a href="#" class="cta"><button>Contact</button></a>
</header>
</body>
</html>
CSS Code
*{
padding: 0;
margin: 0;
font-family: sans-serif;
box-sizing: border-box;
}
#main {
height:100vh;
--webkit-transition: background 6s;
background-image: url(/img/background-image.png);
transition-delay: 2s;
transition-duration: 3s;
background-size: cover;
}
body {
background: black;
}
li, a, button {
font-weight: 500;
font-size: 16px;
color: #edf0f1;
text-decoration: none;
}
header {
display: flex;
justify-content:flex-end;
align-items: center;
padding: 30px 10%;
background:rgba(255, 250, 250, 0.164);
position: sticky;
}
.logo {
cursor: pointer;
margin-right: auto;
font-weight: bolder;
font-size: 3vh;
font-family: Arial, Helvetica, sans-serif;
background: linear-gradient(to right, #f32170,
#ff6b08, #cf23cf, #eedd44);
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
}
.nav_links{
list-style: none;
}
.nav_links li {
display: inline-block;
padding: 0px 20px;
}
.nav_links li a {
transition: all 0.3s ease 0s;
font-weight: bold;
}
.nav_links li a:hover{
color:white;
background:#015958;
border-radius: 50px;
border: none;
cursor: pointer;
transition: all 0.3s ease 0s;
font-weight: bold;
padding: 9px 25px;
}
.nav_links li .active{
color:black;
}
button {
margin-left: 20px;
padding: 9px 25px;
background-color: rgba(0,136, 169, 1);
border-radius: 50px;
border: none;
cursor: pointer;
transition: all 0.3s ease 0s;
font-weight: bold;
}
button:hover {
background-color: rgba(0, 136,169, 0.8);
}
Reference
이 문제에 관하여(HTML과 CSS로 navbar를 만드는 방법.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/user_f9d4a343bb/how-to-create-a-navbar-with-html-and-css-39ch텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)