A dropdown div element which is supposed to work like this in mobile view is appearing like this mobile view In inspect Element.
I tried to change CSS z-index stylings of almost all related nav elements and left this one at "z-index:121212 !important;" and still the dropdown div is appearing behind all the other nav links.
Does anyone know why this is happening? Any help would be greatly appreciated.
Here is my HTML code and it's CSS:
.navbar-mobile .dropdown>.dropdown-active {
display: block;
z-index: 121212;
}
.dropdown-content {
display: none;
position: absolute;
background-color: var(--bg-dark);
min-width: 200px;
box-shadow: 0px 10px 10px 0px rgba(0,0,0,0.2);
z-index: 101000;
animation: marketNav 0.5s;
}
.dropdown-content a {
color: #fff;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover{
background-color: var(--main-color);
color: #000 !important;
}
.dropdown-content a:hover{
color: #1F586B;
}
.dropdown:hover .dropdown-content{
display: inline-block;
}
.nav-pills.has-two .nav-item .nav-link.active {
background-color: var(--main-color);
color: #000;
}
.nav-link{
font-weight: 600 !important;
letter-spacing: 0.8px;
}
#media screen and (min-width: 1024px) {
.support-link{
margin-right: 10px!important;
}
.nav-link{
padding-left: 25px!important;
}
}
.nav-pills.has-two .nav-item .nav-link {
background-color: #000 !important;
color: #fff;
border-radius: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-ms-border-radius: 0;
-o-border-radius: 0;
padding: 12px 20px;
}
<!-- Navigation -->
<header id="header" class="fixed-top ">
<div class="container d-flex align-items-center justify-content-lg-between">
<div class="logo me-auto me-lg-0">
<a href="index.htm">
<span>
<img class="img-fluid rounded sm-device-img text-align" src="asset/theme1/images/logo/logo.svg" width="100%" alt="pp">
</span>
</a>
</div>
<nav id="navbar" class="navbar order-last order-lg-0">
<ul>
<li class="active">
<a class="nav-link" href="index.htm">Home</a>
</li>
<li class="nav-item">
<div class="dropdown">
<a class="dropbtn nav-link">Market</a>
<div class="dropdown-content">
Forex
Cryptocurrencies
Indices
Stocks
Commodities
</div>
</div>
<div class="mobile-view marketNav">
Forex
Cryptocurrencies
Indices
Stocks
Commodities
</div>
</li>
<li class="nav-item">
<div class="dropdown">
<a class="dropbtn nav-link">Trading</a>
<div class="dropdown-content">
Trading Platforms
Tools
Education
benefits
</div>
</div>
<div class="mobile-view marketNav">
<a class="sub-nav-link" href="">Trading Platforms</a>
<a class="sub-nav-link" href="">Tools</a>
<a class="sub-nav-link" href="">Education</a>
<a class="sub-nav-link" href="">benefits</a>
</div>
</li>
<li>
<a class="nav-link" href="">Account Types</a>
</li>
<li>
<a class="nav-link" href="">About</a>
</li>
<li>
<a class="nav-link" href="">Contact</a>
</li>
<li class="d-md-block d-lg-none d-block ">
<a class="nav-link" href="">Login</a>
<a class="btn-border-inverse col-12 btn-sm me-3" href="">Register</a>
</li>
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
</nav>
<div class="header-right d-flex d-none d-md-none d-lg-block">
Login
Register
</div>
</div>
</header>
<!-- Navigation Ends -->
Edit: I found a way to solve this issue. The links weren't able to be clicked when they are behind the main "nav-links". So I added blank divs with heights to appear below the nav-link where the dropdown-content would appear with the help of some JS and CSS to make it hidden in larger screens. Now I am able to click the links in the "dropdown-content".
The problem is not with the z-index, but with the background-color. It is transparent, so it seems like it's behind the other text. You should set the variables you use in your code:
:root {
--bg-dark: #000;
--main-color: #fff;
}
Related
I am struggling with changing the color of my font in my nav bar button eg. Home to white. In my style.css file I first used .navbar-nav li but then the padding did not work, when I changed it to .navbar-nav ul the padding then worked. I then had to use .navbar-nav li a for the next style syntax to work and all seem to work except for the color syntax. Please advise what I am doing wrong for the color syntax not to work.
The color syntax again does not work in my .fa-bars class conditions but the font size in that class does work.
The last problem I seem to have is that the syntax in my .promo-title class does not work. Any help would be much appreciated. Thanks.
* {
margin: 0;
padding: 0;
}
body {
font-family: sans-serif;
}
#nav-bar {
position: sticky;
top: 0;
z-index: 10;
/* sticky on the top */
}
.navbar {
background-image: linear-gradient(to right, #a517ba, #5f1782);
padding: 0;
}
.navbar-brand img {
height: 40px;
padding-left: 20px;
}
.navbar-nav ul {
padding: 0 10px;
}
.navbar-nav li a {
color: #fff;
/*Not working letters in nav bar not white*/
font-weight: 600;
float: right;
text-align: left;
}
.fa-bars {
color: #fff;
/*Not working menu bars not white*/
font-size: 30px;
}
.navbar-toggler {
outline: none;
}
/*--------------banner section------------*/
#banner {
background-image: linear-gradient(to right, #a517ba, #5f1782);
color: #fff;
padding-top: 5%;
/*Extended purple banner down*/
}
.promo-title {
font-size: 40px;
font-weight: 600;
margin-top: 100px;
}
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.2.1/dist/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.2.1/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/#fortawesome/fontawesome-free#5.15.4/css/fontawesome.min.css">
</head>
<body>
<section id="nav-bar">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="#"> <img src="https://via.placeholder.com/50"> </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
<i class="fa fa-bars" aria-hidden="true"></i> <!--adds menu bars when shrinking screen or in mobile view-->
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<!--ml-auto moves navbar to the right side-->
<li class="nav-item">
<a class="nav-link" href="#">HOME</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">SERVICES</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">ABOUT US</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">CONTACT</a>
</li>
</ul>
</div>
</nav>
</section>
<!--Banner section-->
<section id="banner">
<div class="container">
<div class="row">
<div class="col-md-6">
<p class="promo-title">BEST CUSTOM DATABASE COMPANY</p>
<p>Add sentence here not sure what to say just yet but has to be good</p>
</div>
</div>
</div>
</section>
</body>
Your selector specificity isn't high enough, so the Bootstrap styles take precedence. A quick look at your browser's document inspector reveals this. Use a more specific selector.
The same is true for the button (but you should remove the default Bootstrap icon).
* {
margin: 0;
padding: 0;
}
body {
font-family: sans-serif;
}
#nav-bar {
position: sticky;
top: 0;
z-index: 10;
/* sticky on the top */
}
.navbar {
background-image: linear-gradient(to right, #a517ba, #5f1782);
padding: 0;
}
.navbar-brand img {
height: 40px;
padding-left: 20px;
}
.navbar-nav ul {
padding: 0 10px;
}
.navbar.navbar-light .navbar-nav li a {
color: #fff;
font-weight: 600;
float: right;
text-align: left;
}
body .navbar-light .navbar-toggler {
color: #fff;
border-color: #fff;
font-size: 30px;
}
.navbar-toggler {
outline: none;
}
/*--------------banner section------------*/
#banner {
background-image: linear-gradient(to right, #a517ba, #5f1782);
color: #fff;
padding-top: 5%;
/*Extended purple banner down*/
}
.promo-title {
font-size: 40px;
font-weight: 600;
margin-top: 100px;
}
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.2.1/dist/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.2.1/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/#fortawesome/fontawesome-free#5.15.4/css/fontawesome.min.css">
</head>
<body>
<section id="nav-bar">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="#"> <img src="https://via.placeholder.com/50"> </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<i class="fa fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<!--ml-auto moves navbar to the right side-->
<li class="nav-item">
<a class="nav-link" href="#">HOME</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">SERVICES</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">ABOUT US</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">CONTACT</a>
</li>
</ul>
</div>
</nav>
</section>
<!--Banner section-->
<section id="banner">
<div class="container">
<div class="row">
<div class="col-md-6">
<p class="promo-title">BEST CUSTOM DATABASE COMPANY</p>
<p>Add sentence here not sure what to say just yet but has to be good</p>
</div>
</div>
</div>
</section>
</body>
You can use
a.nav-link{
color:#fff!important;
}
I have a HTML and CSS menu and I wanna show the special icon for each item when users hover on each item. I will show you my menu and codes...
.nav{
background-color: #4f9b30;
}
.nav a {
display: inline-block;
color: black;
text-align: center;
padding: 14px;
text-decoration: none;
font-size: 17px;
border-radius: 5px;
}
.nav a:hover {
background-color: #ff5c00;
color: black;
}
.home:hover{
background-image: url(https://ittest.ir/wp-content/uploads/2021/09/home-1.png);
background-repeat: no-repeat;
}
<body>
<div class="nav">
<a class="home" href="#">Home</a>
<a class="ran" href="#">why iran</a>
<a class="blog" href="#">blog</a>
<a class="services" href="#">About</a>
<a class="news"href="#">News</a>
<a class="event" href="#">event</a>
<a class="invest" href="#">invest</a>
<a class="contact" href="#">Contact</a>
</div>
</body>
this is my html and css codes
Because you are using a background image, you can adjust it's position using background-position. https://developer.mozilla.org/en-US/docs/Web/CSS/background-position.
You can adjust padding-left on .nav a to add space from the left edge and the nav text.
.nav{
background-color: #4f9b30;
}
.nav a {
display: inline-block;
color: black;
text-align: center;
padding: 14px 25px 14px 30px;
text-decoration: none;
font-size: 17px;
border-radius: 5px;
}
.nav a:hover {
background-color: #ff5c00;
color: black;
}
.home:hover{
background-image: url(https://ittest.ir/wp-content/uploads/2021/09/home-1.png);
background-repeat: no-repeat;
background-position: 4% 44%;
}
<div class="nav">
<a class="home" href="#">Home</a>
<a class="ran" href="#">why iran</a>
<a class="blog" href="#">blog</a>
<a class="services" href="#">About</a>
<a class="news"href="#">News</a>
<a class="event" href="#">event</a>
<a class="invest" href="#">invest</a>
<a class="contact" href="#">Contact</a>
</div>
I'm trying to make the links appear in the center and when I resize the page to show on mobile I want them to be placed next to each other.
Now there's 3 big blocks on top of each other on mobile. These have to be next to each other and smaller.
.navbar {
overflow: hidden;
background-color: #333;
position: fixed;
bottom: 0;
width: 100%;
}
.container {
overflow: hidden;
background-color: #333;
position: fixed;
bottom: 0;
width: 100%;
}
.navbar a {
display: block;
color: #f2f2f2;
text-align: center;
padding: 32px 32px;
text-decoration: none;
font-size: 17px;
}
.navbar a:hover {
background: #f1f1f1;
color: black;
}
.navbar a.active {
background-color: #4CAF50;
color: white;
}
.main {
padding: 16px;
margin-bottom: 30px;
}
<div class="navbar">
<div class="row">
<li class="nav-link">
QR-Scanner
</li>
<li class="nav-link">
QR-Scanner
</li>
<li class="nav-link">
QR-Scanner
</li>
</div>
</div>
In the code I provided you can see the code of the html page and de CSS. The images contain the view of the mobile version and how it looks on a normal browser on my laptop.
<div class="navbar">
<ul class="row">
<li class="nav-link col-md-4"> QR-Scanner </li>
<li class="nav-link col-md-4"> QR-Scanner </li>
<li class="nav-link col-md-4"> QR-Scanner </li>
</u>
</div>
First of all, your code is incorrect.
There is no nav and ul tag, and your class navbar is in the wrong place.
Your list should be:
<nav class="navbar">
<ul class="navbar-nav">
<li class="nav-link">
QR-Scanner
</li>
<li class="nav-link">
QR-Scanner
</li>
<li class="nav-link">
QR-Scanner
</li>
</ul>
</nav>
Next, you need to change styles in your responsive CSS.
.navbar-nav{
text-align: center;
}
.nav-link{
display: inline-block;
}
Here is the reference:
https://getbootstrap.com/docs/4.3/components/navbar/
Cheers.
I have a bootstrap 4 nav that that works fine except that I cannot figure out how to get the dropdown items into a horizontal subnav whose items centered on the page instead of flush left.
Here's my existing code:
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<!-- Brand -->
<a class="navbar-brand" href="#">Logo</a>
<!-- Links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Link 1</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link 2</a>
</li>
<!-- Dropdown -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
Dropdown link
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Link 1</a>
<a class="dropdown-item" href="#">Link 2</a>
<a class="dropdown-item" href="#">Link 3</a>
</div>
</li>
</ul>
</nav>
<br>
<div class="container">
<h3>Navbar With Dropdown</h3>
<p>This example adds a dropdown menu in the navbar.</p>
</div>
Here's what I would like the menu to look like when a top-level nav link is pressed.
I have been able to get close to this but am having particular difficulty in centering the items in the red subnav.
This what I have that is closer:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
}
.navbar {
overflow: hidden;
background-color: #333;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.subnav {
float: left;
overflow: hidden;
}
.subnav .subnavbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .subnav:hover .subnavbtn {
background-color: red;
}
.subnav-content {
display: none;
position: absolute;
left: 0;
background-color: red;
width: 100%;
z-index: 1;
}
.subnav-content a {
float: left;
color: white;
text-decoration: none;
}
.subnav-content a:hover {
background-color: #eee;
color: black;
}
.subnav:hover .subnav-content {
display: block;
}
</style>
</head>
<body>
<div class="navbar">
Home
<div class="subnav">
<button class="subnavbtn">About <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
Company
Team
Careers
</div>
</div>
<div class="subnav">
<button class="subnavbtn">Services <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
Bring
Deliver
Package
Express
</div>
</div>
<div class="subnav">
<button class="subnavbtn">Partners <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
Link 1
Link 2
Link 3
Link 4
</div>
</div>
Contact
</div>
<div style="padding:0 16px">
<h3>Subnav/dropdown menu inside a Navigation Bar</h3>
<p>Hover over the "about", "services" or "partners" link to see the sub navigation menu.</p>
</div>
</body>
</html>
Still can't figure out how to center text in subnav - again
Any help greatly appreciated.
This solution works but it can be a little tedious. I've wrapped the drop-down items in a div and gave them each their own unique class and a "center" class. Their unique classes set their width, and the center class centers them using auto margins. Here is the edited code:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
margin: 0;
}
.navbar {
overflow: hidden;
background-color: #333;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.subnav {
float: left;
overflow: hidden;
}
.subnav .subnavbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover,
.subnav:hover .subnavbtn {
background-color: red;
}
.subnav-content {
display: none;
position: absolute;
left: 0;
background-color: red;
width: 100%;
z-index: 1;
}
.subnav-content a {
float: left;
color: white;
text-decoration: none;
}
.subnav-content a:hover {
background-color: #eee;
color: black;
}
.subnav:hover .subnav-content {
display: block;
}
/* NEW CSS STARTS HERE */
.center {
margin: 0 auto;
}
.about {
width: 261px;
}
.services {
width: 336px;
}
.partners {
width: 299px;
}
</style>
</head>
<body>
<div class="navbar">
Home
<div class="subnav">
<button class="subnavbtn">About <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<div class="center about">
Company
Team
Careers
</div>
</div>
</div>
<div class="subnav">
<button class="subnavbtn">Services <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<div class="center services">
Bring
Deliver
Package
Express
</div>
</div>
</div>
<div class="subnav">
<button class="subnavbtn">Partners <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<div class="center partners">
Link 1
Link 2
Link 3
Link 4
</div>
</div>
</div>
Contact
</div>
<div style="padding:0 16px">
<h3>Subnav/dropdown menu inside a Navigation Bar</h3>
<p>Hover over the "about", "services" or "partners" link to see the sub navigation menu.</p>
</div>
</body>
</html>
Not sure if you want it to span the entire width of the screen but if you want to just have them be organized in a row instead of a column you can add a bootstrap d-flex to not have it be in the default display:block
<div class="dropdown-menu d-flex">
<a class="dropdown-item" href="#">Link 1</a>
<a class="dropdown-item" href="#">Link 2</a>
<a class="dropdown-item" href="#">Link 3</a>
</div>
I have created a drop down style menu using scss and bootstrap. I have been able to set everything up as required with one issue.
When hovering over the arrow on top of the drop down menu it highlights the arrow, I don't want this to happen. The arrow should only highlight when the first menu item is on hover.
How could I fix this? See codepen link :
https://codepen.io/duodice/pen/NJJXYJ
(images don't load that's fine as they're local files)
To replicate the problem :
1. Hover over "Services" on navbar
2. Hover over small triangle at the top of drop down menu
The scss :
$pop-up-menu-bg-clr : white;
$pop-up-menu-shade-clr : #B0c1d3;
$pop-up-menu-font-clr : #1b2b43;
.pop-up-menu-container {
position: relative;
li:hover {
.pop-up-menu-list {
display: block;
}
}
}
.pop-up-menu-list {
display: none;
position: absolute;
top: 100%;
left: 0;
width: 100%;
padding-top: 1.5rem;
background-color: transparent;
z-index: 999;
li a {
transition: none !important;
display: block;
color: $pop-up-menu-font-clr;
text-align: left;
background-color: $pop-up-menu-bg-clr;
width: 100%;
padding: 1rem;
&:hover {
background-color: $pop-up-menu-shade-clr;
color: white;
}
img {
height: 80%;
}
p {
color: $pop-up-menu-font-clr;
font-size: 13px;
margin-bottom: 0;
}
}
li:first-child {
position: relative;
z-index: 998;
&:hover {
border-bottom-color: y
}
a {
border-radius: 15px 15px 0 0;
}
&:before {
position: absolute;
content: "";
width: 0;
height: 0;
border: 1rem solid transparent;
border-bottom-color: $pop-up-menu-bg-clr;
top: 0;
left: 30%;
margin-top: calc(-2rem + 1px);
}
&:hover:before {
border-bottom-color: $pop-up-menu-shade-clr;
}
}
li:last-child a {
border-radius: 0 0 15px 15px;
}
}
Html :
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" id="sidebarCollapse" data-toggle="collapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end">
<ul class="navbar-nav pop-up-menu-container">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Services</a>
<ul class="pop-up-menu-list list-unstyled">
<li>
<a href="#">
<div class="row">
<div class="col-2 mr-2">
<img src="wwwroot/images/icons/settings.svg">
</div>
<div class="col">
All Services
<p>Learn more about our services</p>
</div>
</div>
</a>
</li>
<li>
<a href="#">
<div class="row">
<div class="col-2 mr-2">
<img src="wwwroot/images/icons/web_development_devices.svg">
</div>
<div class="col">
Web Development
<p>Design & Development</p>
</div>
</div>
</a>
</li>
<li>
<a href="#">
<div class="row">
<div class="col-2 mr-2">
<img src="wwwroot/images/icons/hosting_cloud.svg">
</div>
<div class="col">
Hosting & Maintenance
<p>Store your site online</p>
</div>
</div>
</a>
</li>
<li>
<a href="#">
<div class="row">
<div class="col-2 mr-2">
<img src="wwwroot/images/icons/marketing_growth.svg">
</div>
<div class="col">
Digital Marketing
<p>Get more visitors today</p>
</div>
</div>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Disabled</a>
</li>
</ul>
</div>
</div>
</nav>
Thanks.
You set hover to li of first child without a (as you set to rest of li):
Change it to li a:hover:
See working code
li:first-child {
position: relative;
z-index: 998;
a:hover {
border-bottom-color: y
}
a {
border-radius: 15px 15px 0 0;
}
a:before {
position: absolute;
content: "";
width: 0;
height: 0;
border: 1rem solid transparent;
border-bottom-color: $pop-up-menu-bg-clr;
top: 0;
left: 30%;
margin-top: calc(-2rem + 1px);
}
a:hover:before {
border-bottom-color: $pop-up-menu-shade-clr;
}
}