Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8233713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:13:28+00:00 2026-06-07T18:13:28+00:00

Is it possible to trigger a :hover event whenever a Mobile Safari user single

  • 0

Is it possible to trigger a :hover event whenever a Mobile Safari user single taps on a div area?

It does not have to be a link. Actually, it can’t be a link because the user will go to another webpage.

The hover effect I have applied is actually on a div : #div:hover {color:#ccc;}
I would like for this hover to happen whenever an iPad or iPhone user single taps on the div area.

I know that piece of CSS exists for the background color of a link:
-webkit-tap-highlight-color:rgba(200,0,0,0.4);
But this does not apply to my situation.

If this could apply to the color of the text, for example, then I could use it.

Update: Please see my accepted answer below

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:13:30+00:00Added an answer on June 7, 2026 at 6:13 pm

    I have figured out how to trigger :hover when a user taps on a div area without using javascript. This is done using display:none; and display:block;.

    For example:

    <div class="block">
        <p>This content is shown *before* the user hovers over .block or taps .block on an iOS device.</p>
        <div class="mask">
            <p>This content is shown *after* the user hovers over .block or taps .block on an iOS device.</p>
        </div>
    </div>
    

    CSS:

    .block {
        width:300px;
        height:300px;
        background:black;
    }
    
    .mask {
        width:300px;
        height:300px;
        background-color:gray;
        display:none;
    }
    
    .block:hover .mask {
        display:block;
    }
    

    I have found that the :hover only triggers on iOS while using display (as opposed to opacity). Also, CSS transitions ignores display so this cannot be transitioned with CSS. If you’d like the transition for desktop users, you can add opacity:0; and opacity:1;

    EDIT: CSS visibility also seems to work.

    Thanks for the time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to trigger an event when the user changes the system date
Is it possible to trigger copy event from JavaScript/jQuery? I want to simulate copy
Is is possible to trigger a link to select a single line inside textarea.
<label for=input>Label</label><input type=file id=input/> In Firefox 7 it is not possible to trigger the
is is possible in postgres to have a trigger on CREATE TABLE that will
Is it possible to trigger Flex Piechart Item click event when a Datagrid Item
Possible Duplicate: How to show/hide a div on mouseover using jquery? I have a
Possible Duplicate: Trigger an event with Prototype example, 3 onclick events in javascript/prototype. How
Is it possible to trigger a refresh for a div when you click a
Is it possible to trigger a mouseout event on a link element using jQuery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.