The hyperlink does not function properly when first tapped on an iPhone

My link that utilizes css pseudo classes is behaving differently on Android compared to iPhone. Strangely, it only works on the second click on the iPhone. Can anyone provide a solution for this issue?

.link{float:left;}
.link a {
    color: #000;
    font-size: 15px;
    font-weight: 400;
    padding: 10px;
    display: inline-block;
    border: 1px solid #b6fe54;
    -webkit-transition: all .5s ease-in-out;
    -moz-transition: all .5s ease-in-out;
    -o-transition: all .5s ease-in-out;
    transition: all .5s ease-in-out;
    position: relative;
}
.link a:before {
    position: absolute;
    content: "";
    width: 0px;
    background: #b6fe54;
    left: 0px;
    top: 0px;
    height: 100%;
    z-index: -1;
    -webkit-transition: all .5s ease-in-out;
    -moz-transition: all .5s ease-in-out;
    -o-transition: all .5s ease-in-out;
    transition: all .5s ease-in-out;
}
.link a:hover:before {
    width: 100%;
}
<div class="link"><a href="https://www.google.co.in" target="_blank">Learn More</a></div>

Answer №1

Include the code snippet below:

<script>
var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if(!iOS)
  document.write('\x3Cstyle>.link a:hover:before {width: 100%;}\x3C/style>');
</script>

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

Is it possible to precisely position multiple children in a relative manner?

I am currently developing a custom dropdown menu where I want the parent element to be relatively positioned within the page. The goal is for all the child elements of the dropdown menu (the list items) to appear as if they are part of a select element and ...

Extracting data from HTML attributes with Java

As an example, I will provide a snippet of source code from the Amazon.com website and explain my HTML guidelines. <div id="result_25" class="fstRowGrid prod celwidget" name="B00IVPU786"> <div class="image imageContainer"> <a hr ...

CSS: width is functional but height is ineffective

When trying to adjust the width of a div, everything works smoothly, but the same cannot be said for adjusting the height. I attempted to experiment with the bootstrap carousel on codeply, but unfortunately, it didn't behave as anticipated: HTML code ...

Extracting the value of an input field using jQuery

Is there a way to dynamically change the perPage value in this jQuery code based on user input from an input field? I need to create pagination for a table and allow the user to control the number of rows displayed per page. $(document).ready(function(){ ...

Exploring file directories in your web browser using Node.js - a guide to embedding a file system path in your HTML response

I am currently facing an issue where I am trying to retrieve content from my nodejs express controller that includes a file system link for viewing logs in the browser. However, when I click on this link, nothing happens. The logs specified in the href li ...

What's the best way to combine cells using HTML, CSS, and PHP?

Can anyone assist me with merging cells containing identical values in specific columns? <td style="text-align: center; font-size: 9.5px;">{{$endereco->quadra}}</td> <td style="text-align: center; font-s ...

Placing a crimson asterisk beside the input field within Bootstrap

Trying to insert a red * at the end of my input field using bootstrap, but all my attempts so far have been unsuccessful. Is there a way to align the Currently experiencing this issue: https://i.stack.imgur.com/61pzb.png Code snippet: .required-after ...

Customize your cube with unique ThreeJs text on every face!

I am currently experimenting with Three.js to create a rotating cube with unique text on each face. I have managed to use DynamicTexture to assign text to the faces of the cube, but it is displaying the same text on all sides. Is there a way to display dif ...

Style applied directly to .col elements

I want to customize the styling of the .col elements on a single page without affecting other pages. I've tried adding the following code snippet to my CSS file: .col { border: 1px solid #7851A9; } However, this also styles the element ...

C# code that generates HTML buttons for redirection

I've been working on developing a C# string builder that will be used to construct an HTML page using data from a database and user input. My current challenge involves adding two buttons to the string - one that redirects to a.asp and the other to b ...

Converting HTML to PDF in Java using iText with proper formatting of <pre> blocks

I am currently using iText for the purpose of converting HTML file structure to PDF format. Within my HTML files, I have included code snippets enclosed in <pre> blocks, but unfortunately, iText does not preserve their original formatting. Here is a ...

Creating a customizable Sass Mixin for animation keyframes that incorporates various stages and the transform property

My goal is to generate the standard CSS using a SASS Mixin for efficiency. STANDARD CSS @-webkit-keyframes crank-up { 100% { -webkit-transform: rotate(360deg);} } @-moz-keyframes crank-up { 100% { -moz-transform: rotate(360deg);} } @-o-keyframes cran ...

Bring your text to life with animated movement using HTML5 and/or CSS3

My goal is to have a snippet of text, like "Lorem Ipsum..." slide horizontally into a colored DIV quickly, then smoothly come to a slow stop, continue moving slowly, speed up again, and exit the DIV - all while staying within the boundaries of the DIV. I ...

Utilizing Z-Index placement in CreateJS

I'm struggling to adjust the z-index for my line Graphic(). My goal is to ensure that the line always appears behind the other two shapes. Based on my understanding, the first element added has a z-index of 0, the second one has a z-index of 1, and s ...

Apply CSS styles from a text area using v-html

I am currently working on developing a unique WYSIWYG application where users have the ability to write CSS in a textarea field and view its direct impact on the HTML content displayed on the page. As I was experimenting with different approaches, I attemp ...

The Heroku application is rendering with different CSS and positioning compared to the local development environment

My locally hosted site has correct CSS and positioning, but once deployed to Heroku, it appears to lose some of its CSS styles. I am using the MERN Stack for this project. I suspect that the issue may be related to my node_modules, even though I have them ...

Video full screen button is hidden during playback in Android KitKat's WebView

I am trying to display a video in full screen using webview in my application. I followed a tutorial available at Everything works perfectly on android versions 4.1.2 and 4.2.2, but on KitKat (4.4.2) the full screen button disappears when the video is pla ...

Problem with CSS in the Internet Explorer 8 browser encountered

While working on a project, I encountered an unexpected design issue on a client's machine that has Internet Explorer 8 installed. Interestingly enough, when testing on my own machine with IE 9 and using F12 to switch to compatibility mode for IE 8/7, ...

Include an additional icon without replacing the existing one on the mouse cursor

I am looking for a way to enhance the user experience by adding an icon that appears when hovering over an HTML element, serving as a subtle hint that the user can right-click. Instead of replacing the default cursor, which varies across platforms and doe ...

I'm having difficulty grasping how this CSS is being used

There's something strange about the way this CSS is being used, and I can't quite wrap my head around it. .tablecontainer table { ... } I'm familiar with table.tablecontainer, which indicates that the class attribute is equal to "table ...