My current focus is on making my website responsive with a breakpoint set at 576px
I am aiming to achieve the design shown in this image without any space in the border-bottom and have both elements expand to full width: menu li hover
However, I'm currently facing an issue where my menu li has unwanted space as seen here: my menu li - with space
Any assistance would be greatly appreciated.
Thank you in advance! Have a wonderful day!
Here's the code snippet I've been working on:
/*-------------------Header desktop size-------------------*/
.header {
margin: auto;
max-width: 1440px;
}
.header div {
display: flex;
justify-content: space-between;
height: 100px;
align-items: center;
margin: auto;
}
.header img {
margin: 10px 60px 0px 55px;
}
.menu {
display: flex;
flex: 1;
justify-content: flex-end;
list-style-type: none;
margin: 20px 80px 0 0;
padding-right: 30px;
}
.menu ul {
display: flex;
list-style-type: none;
}
.menu-items {
text-decoration: none;
color: black;
font-size: 18px;
}
.menu-items:hover {
color: #0065fc;
}
.menu li {
display: flex;
margin-right: 60px;
font-weight: normal;
font-size: 18px;
}
/*-------------------Header mobile size-------------------*/
@media all and ( max-width: 576px) {
/*-- header --*/
.menu {
margin-right: 0px;
}
.menu nav {
position: relative;
flex-basis: 100%;
order: 2;
display: flex;
}
.menu ul {
display: flex;
flex-basis: 100%;
order: 2;
position: relative;
top: 50px;
right: 160px;
padding-top: 30px;
margin-top: 20px;
margin-left: -30px;
}
.menu-items {
border-bottom: 3px solid #f2f2f2;
padding-bottom: 10px;
width: 250px;
}
.menu-items:hover {
border-bottom-color: #0065FC;
}
.sign-up {
position: absolute;
padding-top: 0px;
margin-top: 40px;
margin-right: 0px;
padding-left: 5px;
color: #0065fc;
text-decoration: none;
width: 165px;
transition: all 0.4s;
right: 9px;
}
}
<header class="header">
<div>
<div><a href="#" class="header-logo"></a>
<img src="images/logo/Reservia.svg" alt="Logo Reservia">
</div>
<nav class="menu">
<ul>
<li><a href="#search-lodging" class="menu-items" title="Hébergements">Hébergements</a></li>
<li><a href="#search-activities" class="menu-items" title="Activités">Activités</a></li>
</ul>
<a href="#" class="sign-up" title="S'inscrire <strong>S'inscrire</strong></a>
</nav>
</div>
</header>