JSFiddle - React, Tailwind, and code Playground
by qunzorez
HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script link="script.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="header">
<div class="header-navbar">
<div class="container">
<div class="box">
<ul>
<li><a href="pages/index-about.html">Projects</a></li>
<li><a href="pages/index-about.html">About</a></li>
<li><a href="pages/index-about.html">Contact</a></li>
<!--Here's the image:-->
</ul>
</div>
<div class="box"><a href="index.html"><img class="header-logo" src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/97/Logo%21_Logo.svg/1200px-Logo%21_Logo.svg.png" /></a></div>
</div>
</div>
</div>
</body>
</html>
CSS
.container {
display: flex;
}
.box {
flex: 1;
display: flex;
justify-content: flex-start;
}
.box:first-child>span {
margin-right: auto;
}
.box:last-child>span {
margin-left: auto;
}
/* non-essential */
.box {
align-items: center;
height: 40px;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #fff;
}
li {
float: left;
}
li a {
display: block;
float: left;
color: black;
text-align: center;
padding: 5px 16px;
text-decoration: none;
border-radius: 5px;
}
li a:hover {
background-color: rgb(241, 241, 241);
transition: 0.3s;
}
li a:active {
color:rgb(41, 41, 41);
}
.header-logo{
height: 40px;
}