I have just finished coding the following HTML code:
My main goal is to align the list items -
HOME | All About Kittens | Feeding Your Kitten
in a proper layout. Currently, they are displayed as a simple list. However, I would like them to be aligned horizontally like this:
https://i.sstatic.net/3I3Zm.png
In this example, the list items are Home, Shop, and collections arranged in a horizontal line.
Additionally, when hovering over an item, it should change color, and a line should appear below it.
Do you have any ideas on how I can achieve this layout using CSS?
a {
color: black;
text-decoration: none;
}
.promo_banner {
background-color: #333;
text-align: center;
color: #fff;
font-size: 12px;
position: relative;
width: 100%;
z-index: 5000;
top: 0;
overflow: hidden;
}
div.logo img {
max-width: 205px;
width: 100%;
margin: 0 auto;
display: block;
max-width: 100%;
height: auto;
}
<html>
<head>
<link rel="stylesheet" href="home.css" />
</head>
<div class="promo_banner">
<div class="promo_banner__content">
<p>
<strong>Our Guide on Caring for Your Furry Feline Friend</strong>
</p>
</div>
<div class="promo_banner-close"></div>
</div>
<div class="top_bar clearfix">
<ul class="social_icons">
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<div class="container">
<span><a href="https://www.twitter.com"><i class="fab fa-twitter"></i><a href="https://www.twitter.com"></a></span>
<span><i class="fab fa-facebook-f"></i></span>
<span><i class="fab fa-youtube"></i></span>
<span><i class="fab fa-instagram"></i></span>
</div>
</ul>
</div>
<div class="logo text-align--center">
<a href="https://store.linefriends.com" title="LINE FRIENDS INC">
<img
src="logo.jpeg"
class="primary_logo lazyloaded"
alt="LINE FRIENDS INC"
/></a>
</div>
<div class="nav">
<ul class="menu center">
<li >
<span>HOME</span>
</li>
<li >
<span>All About Kittens</span>
</li>
<li >
<span>Feeding Your Kitten</span>
</li>
</ul>
</ul>
</div>
</html>
https://i.sstatic.net/MhrhV.png https://i.sstatic.net/DYE9P.jpg