The hyperlink tag doesn't respond to clicks in Safari, yet functions properly in all other web browsers

I'm encountering an issue with my header drop-down menu in Safari—it works perfectly in Chrome, but when I try to open the drop-down menu in Safari, it's unresponsive. Clicking on it does nothing, preventing me from accessing other drop-downs. Have you faced a similar problem before? I've experimented with using both <a> tags and <span>, but there hasn't been any change.

Below is the snippet of my code:

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

header {
  top: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  padding: 0px 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10000;
  .navbar ul {
    list-style: none;
  }
  .navbar ul li {
    position: relative;
    float: left;
  }
  .navbar ul li a,
  span {
    padding: 20px;
    color: #111d5e !important;
    font-weight: 600;
    text-decoration: none;
    display: block;
  }
  .navbar ul li a:after {
    background: none repeat scroll 0 0 transparent;
    bottom: 0;
    content: "";
    display: block;
    height: 2px;
    box-shadow: inset 3000px 0 0 0 #eed484;
    transition: width 0.3s ease 0s, left 0.3s ease 0s;
    width: 0;
  }
  .navbar ul li a:hover:after {
    width: 100%;
    left: 0;
  }
  .navbar ul li span:after {
    background: none repeat scroll 0 0 transparent;
    bottom: 0;
    content: "";
    display: block;
    height: 2px;
    box-shadow: inset 3000px 0 0 0 #eed484;
    transition: width 0.3s ease 0s, left 0.3s ease 0s;
    width: 0;
  }
  .navbar ul li span:hover:after {
    width: 100%;
    left: 0;
  }
  .navbar ul li ul li span,
  a {
    width: 100%;
  }
  .navbar ul li ul {
    position: absolute;
    left: 0;
    width: 250px;
    background: #ffffff;
    display: none;
    align-items: flex
  }
  .navbar ul li ul li {
    width: 100%;
  }
  // .navbar ul li:focus-within > ul,
  .navbar ul li:hover>ul {
    display: initial;
    z-index: 100;
  }
  #menu-bar {
    display: none;
  }
  label {
    font-size: 20px;
    color: #111d5e !important;
    cursor: pointer;
    display: none
  }
  .navbar ul li .language {
    width: 155px;
  }
}

@media (max-width: 991px) {
  header {
    padding: 15px;
  }
  header label {
    display: initial;
  }
  header .navbar {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #ffffff;
    display: none;
    z-index: 99999;
  }
  header .navbar ul li {
    width: 100%;
  }
  header .navbar ul li ul {
    position: relative;
    width: 100%;
  }
  header .navbar ul li ul li {
    background: #ffffff
  }
  header .navbar ul li ul li ul {
    width: 100%;
    left: 0;
  }
  #menu-bar:checked~.navbar {
    display: initial
  }
  header .navbar ul li .language {
    width: 100%;
  }
  header .navbar ul a {
    display: block;
    width: 100%;
    height: 100%;
  }
}
<header>

  <img routerLink="" style="cursor: pointer" src="assets/logo.png" alt="">


  <input type="checkbox" id="menu-bar">

  <label for="menu-bar">{{'header.fifth' | translate}}</label>


  <nav class="navbar">
    <ul>
      <li><a routerLink="">{{'header.first' | translate}}</a></li>
      <li style="cursor: pointer;"><a>{{'header.second' | translate}} </a>
        <ul style="cursor: pointer;">
          <li><a style="cursor: pointer;" routerLink="/customs">{{'body.head-1' | translate}}</a></li>
          <li><a style="cursor: pointer;" routerLink="/terrestrial">{{'body.head-2' | translate}}</a></li>
          <li><a style="cursor: pointer;" routerLink="/ship">{{'body.head-3' | translate}}</a></li>
          <li><a style="cursor: pointer;" routerLink="/train">{{ 'body.head-4' | translate}}</a></li>

        </ul>
      </li>
      <li style="cursor: pointer;"><a>{{'header.fourth' | translate}}</a>
        <ul class="language" style="float: left !important; cursor: pointer;">
          <li><a (click)="setLang('ka')" style="cursor: pointer" class="dropdown-item">{{'language.first' | translate}}</a></li>
          <li><a (click)="setLang('en')" style="cursor: pointer" class="dropdown-item">{{'language.second' | translate}}</a> </li>
          <li><a (click)="setLang('ru')" style="cursor: pointer" class="dropdown-item">{{'language.third' | translate}}</a> </li>

        </ul>
      </li>

    </ul>
  </nav>

</header>

Answer №1

Encountered a problem where <a> tags were not clickable within text. After investigating, I discovered that the issue was related to display:inline not being compatible. The problem was resolved by adding display:inline-block.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the correct method for caching fonts within an Angular application?

In the process of developing a web application similar to photoshop-minis using Angular, one key aspect I am focusing on is reducing load times. Particularly when it comes to fonts, as not all necessary fonts are available through Google Fonts. Instead of ...

Instead of displaying the name, HTML reveals the ID

I have defined a status enum with different values such as Draft, Publish, OnHold, and Completed. export enum status { Draft = 1, Publish = 2, OnHold = 3, Completed = 4 } In my TypeScript file, I set the courseStatus variable to have a de ...

Prerender is running independently of the dynamic page title and meta tags rendering process

As part of a POC, I was integrating prerender.io with an angular-node application for SEO purposes. My application can be found HERE. The good news is that all three links are being crawled successfully, as confirmed by receiving a 200 OK status for all li ...

Ensuring scroll position remains fixed post screen rotation in HTML/Javascript

Is there a foolproof method to retain the scroll position in an HTML document following a screen rotation? While this issue is specifically in a Cocoa Touch UIWebView, it seems to be prevalent across different platforms. The standard practice appears to re ...

Utilize multiple background images in CSS with a set of three unique images

I have inserted three images into the background of my website's body. Two of them are displaying correctly (one with repeat-y), but the third one is not working. I've tried searching a lot but couldn't find a solution. body { backgr ...

Tips for cropping an image using CSS with dimensions specified for width, height, and x and y coordinates

As I work on implementing a cropping feature using react-easy-crop, my goal is to store the user's image along with pixel coordinates that dictate their preferred cropping area. My objective is to utilize the parameters provided by react-easy-crop in ...

Ways to release the binding of an element and then re-enable it for future use

Encountering an issue with dynamically unbinding and binding elements using jQuery. Currently working on creating a mobile tabbing system where users can navigate using left and right arrows to move content within ul.tube. The right arrow shifts the ul.tu ...

Adjusting the size of an image based on the size of the window

I'm currently working on my first website project. I have successfully implemented a large image banner, however, I am facing an issue with setting its height. Whenever I try to adjust the height using percentage values, the banner disappears. My goal ...

Adjust the color of a div's background when clicked by solely using CSS

I'm looking to change the color of a specific div when it's clicked on among three different ones. The goal is to indicate which one is active without reverting back to the original color once the mouse is released, similar to a focus effect. I&a ...

Adjust the quantity by clicking or typing

Hey there! How's it going? I'm curious to learn how I can enable the user to manually input the quantity in the field, in addition to using the plus and minus buttons. Essentially, is there a way for the user to type in the number of items they ...

Scroll sideways with AJAX content replacement

I've successfully discovered various methods for loading and replacing content with ajax, as well as ways to hide/show with effects. However, I'm now seeking a technique that allows the new content to slide into a div while the old content slide ...

Effortlessly Concealing Numerous Elements with a Single Click in Pure JavaScript

I have successfully created an HTML accordion, but I am facing an issue. I want to implement a functionality where clicking on one accordion button will expand its content while hiding all other accordion contents. For example, if I click on accordion one ...

Refresh Angular component upon navigation

I have set up routes for my module: const routes: Routes = [ { path: ":level1/:level2/:level3", component: CategoriesComponent }, { path: ":level1/:level2", component: CategoriesComponent}, { path: ":level1", component: ...

Utilizing the Strength of Code Snippets and the Art of Style Sheet Separation

When it comes to developing beautiful web pages and forms from scratch, I often struggle as the end result tends to be quite unappealing. Luckily, there are numerous CSS code snippets available that offer stunning solutions. Currently, I am delving into py ...

A guide to implementing unit tests for Angular directives with the Jest testing framework

I am currently integrating jest for unit testing in my Angular project and I am relatively new to using jest for unit tests. Below is the code snippet for DragDropDirective: @HostListener('dragenter',['$event']) @HostListener(& ...

The table appears to be fixed in place and will not scroll, even though the data

Previously, my code was functioning perfectly with the mCustomScrollbar I implemented to scroll both vertically and horizontally on my table. However, while revising my jQuery code for organization purposes, I seem to have unknowingly altered something tha ...

Alignment of columns within an HTML grid

I can't seem to figure out why my grid column headers are not aligning properly with the data in the grid. It's puzzling that they have the same CSS class but different sizes. Can someone please help me with this: .outer { width: 60%; heig ...

hyperlink to choose a specific option from a drop-down menu

The challenge I am currently working on involves page1.html <a href="/foo"></a> foo.html <select ng-model="ctrl.listvalues"> <option id="{{item.value}}" ng-repeat="item" in ctrl.availableValues" value="{{item.value}}">item.di ...

Using Jquery to toggle the visibility of divs based on radio button selections

I am struggling to hide the divs with the radio buttons until their title is clicked on. However, I am facing issues as they are not showing up when their title is clicked on. Any assistance would be greatly appreciated. SPIKE <!DOCTYPE html> &l ...

Ways to conceal CSS on the page when triggering a different element

I am trying to achieve the functionality of hiding the black arrow when clicking on the green arrow, all without using jQuery. Here is my fiddle: http://jsfiddle.net/t5Nf8/195/ html: <div class="arrow-down"></div> <div class="arrow-up"> ...