What steps can be taken to stop Internet Explorer from interfering with a hover trigger on a child element?

I'm encountering an issue with my HTML and CSS code that seems to work perfectly in all browsers except for IE10 and below. The problem arises on a user profile page where there is a profile picture (avatar).

When hovering over the avatar, the CSS triggers a div inside the avatar div to transition from 0 opacity to 1. Within this div, there is a Tweet button embedded using an iframe and Socialite, though this detail is not relevant to the issue at hand.

In IE, when hovering over the avatar, the button displays correctly as intended. However, upon attempting to hover over the Tweet button itself, it blocks the cursor interaction with the avatar div causing it to disappear. This behavior in IE is unexpected since the outside trigger div should encompass everything within it.

Below is the HTML snippet utilizing Handlebars:

<div class="profile-avatar" style="background-image:url({{avatar_url}})">
  <div class="avatar-overlay">
    <div class="tweet-profile">
      <a href="//twitter.com/share" class="socialite twitter-share" data-count="none" data-text="Check out my profile!" data-url="{{url}}" rel="nofollow" target="_blank"></a>
    </div>
  </div>
</div>

And here's the CSS (written in Stylus syntax):

.profile-avatar
  @extend .background-cover
  height 120px
  margin-bottom 10px
  position relative

  &:hover
    .avatar-overlay
      opacity 1

.tweet-profile
  position absolute
  top 50px
  left 32px

  &:hover
    opacity 1

.avatar-overlay
  position absolute
  left 0px
  top 0px
  width 100%
  height 100%
  background-color rgba(0,0,0,0.5)
  opacity 0
  transition opacity 250ms

Answer №1

Have you experimented with this code snippet?

 .profile-avatar .tweet-profile
    position absolute
    top 50px
    left 32px
    z-index 999999999

    &:hover
      opacity 1

Furthermore, the hover effect on:

.profile-avatar
  @extend .background-cover
  height 120px
  margin-bottom 10px
  position relative

  &:hover
    .avatar-overlay
      opacity 1

Seems incorrect, since it contains a class within the hover state? To solve this, I would suggest trying the following in Stylus:

 &:hover .avatar-overlay
   opacity 1

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

Not all Angular Material2 styles are being fully applied

One issue I am encountering is that styles for components such as <mat-chip> or <button mat-raised-button> (the only ones I have found) are not working properly and appear gray by default. However, styles do apply correctly to the <mat-card& ...

Tips for customizing the appearance of buttons in a JavaScript bxSlider

Take a look at my landing page: In the upper section, you'll find three buttons that allow you to switch between different slides. These buttons are named: credi5, credi10, and credi15. Now, I want to replace those buttons with images... specificall ...

Create a distinct CSS animation 'origin' declaration for every <g> element

I am using CSS animation to apply a 'wobble' effect to each letter within a word. The letters are represented by SVG groups <g>. However, in the provided example, the wobbling effect becomes more pronounced with each subsequent letter, wher ...

Are there any class options that offer a wider width than modal-lg?

I am currently using vue.js along with Bootstrap. Within my modal dive, I am looking for a class that will help me increase the width of the modal div, As you can see from the image below, my modal div looks like this. I plan on adding 12 more tabs, whic ...

An easy way to switch animations using CSS display:none

Dealing with some missing gaps here, hoping to connect the dots and figure this out. I'm attempting to create a functionality where a div slides in and out of view each time a button is clicked. Eventually, I want multiple divs to slide out simultane ...

Is there a way for my HTML file to connect with my CSS and JavaScript files stored in an Amazon S3 Bucket?

My current project involves hosting an HTML file as a website on AWS S3 in order to circumvent the CORS Policy. However, when I uploaded all my files into a new bucket, the HTML file was able to open but without accessing the accompanying CSS and JavaScrip ...

In order to effectively utilize and display images on a webpage, I require a JavaScript array to store image links for use as image sources

I need assistance with changing these images. I am trying to store their links in an array, but when I click the button to change the image, it does not recognize that the array variable points to an image. Can someone offer guidance? Here is my current ...

Utilizing conditional styling in React: the ability to add or attach CSS classes based on

Is there a more efficient way to implement conditional formatting for this scenario? const PaginationStorePageLink = ({ store, pageNum }) => (observer(({ PaginationStore }) => { const className = this.props.store.currentPage === this.props.pageNum ...

Delete the designated column from the table

I am having difficulty with hiding and showing table columns using checkboxes. I need to eliminate the Mars column (in bold) along with its corresponding data (also in bold). Once the Mars column is removed, I want the Venus column and its data values to ...

Keep fancybox items in their designated spot

When the window is opened at full size, everything looks fine. However, when you resize the window horizontally, the thumbnails shift and disappear. I want them to remain fixed in their position like the large pop-up image so that users can still see them ...

Animate items in a list by staggering their appearance during the initial rendering

I am currently working on creating a navigation menu that has a staggered effect when the list items appear upon opening the menu. Using a burger symbol to toggle the navigation menu to fullscreen, I want to incorporate an animation where each list item ( ...

Transform Vue.js into static HTML output

Is there a way to convert a Vue.js component into static html without the need for javascript? I am specifically interested in retaining styles. I am searching for a library where I can execute code similar to this: SomeNestedComponent.vue <template> ...

Please click on the element located in the top right corner of the image

I am attempting to place a font icon in the top right corner of some images, with the intention of only triggering an event when I click on the icon. However, my current setup causes the entire image to trigger the click event. How can I restructure this t ...

Integrate div columns within the content of Bootstrap tabs

Utilizing the X-tabs plugin, I have been working with Bootstrap 3 tabs and styling them as shown below: HTML : <div class='tabs-x tabs-below'> <div id="myTabContent-2" class="tab-content"> <div class="tab-pane fade in ...

What could be causing my CSS Grid to misbehave?

I am diving into the world of CSS Grid and attempting to create a sign-up page similar to that of Facebook. The layout I have in mind involves placing the first name and last name on one line, the email address on another line, and a submit button on a th ...

Using the HtmlTable Control to populate data from an HtmlTable object in ASP/C# Programming

It seems like a simple question, but I'm struggling to populate an HtmlTable control, accessible from codebehind, with data from an HtmlTable object already containing information. Could someone offer me guidance on this issue? Thank you in advance. ...

What could be the reason for Express not retrieving my external CSS file?

The console consistently displays the message: GET http://localhost:8000/public/stylesheets/mystyle.css. Upon examining the image attached below, it is evident that this path is incorrect. I utilized WebStorm to create the href attribute for the CSS. app ...

correcting mistakes in the design of the website

After inserting Google Adsense on my website, the content of the site moved down. Is there a way to have the content appear alongside the Google Adsense rather than below it? You can view my site here: .wrapper { width: 990px; margin: 0 auto; ...

CloudFront for Amazon - Limit MP3 playback to designated website

I've been trying to find a solution for allowing mp3 files in an Amazon S3 bucket paired with Cloudfront to be streamed directly on my site without revealing the source URL of the mp3s. I want to prevent others from sharing or leeching the link by vie ...

Dash reveals the empty space between the border of the card and the header

I am currently facing an issue with the bootstrap cards in my Dash app. Specifically, my app is using the Flatly stylesheet and includes only one card as shown below. import dash import dash_bootstrap_components as dbc app = dash.Dash(__name__,external_st ...