I am unable to delete the "background: linear-gradient" styling from the button

I'm having trouble getting the button to overlay on top of "background: linear-gradient" without the background disappearing when hovered. Any assistance would be greatly appreciated.

demo: https://jsfiddle.net/qgj18a4b/

<div class="image">
   <img style="object-fit: cover; width:350px; height:250px;" src="https://st.depositphotos.com/1224365/2498/i/950/depositphotos_24980235-stock-photo-portrait-of-a-normal-man.jpg" alt="">
   <button type="button" class="mybuttonoverlap btn btn-info">Read More</button>
   <div class="qualquer">MISSÃO E OBJETIVOS</div>
</div>

  .image {
    position: relative;
    z-index:1;
    display: flex;
    justify-content: center;
  }
  
  .image::after{
    content:"";
    position:absolute;
    background: linear-gradient(0deg,        rgba(39,38,42,1) 0%, rgba(255,255,255,0)     60%);
    z-index:2;
    height:100%;
    width:100%;
    top:0;
    left:0;
  }
  
 .image:hover .qualquer {                          
    top: 50%;
  }
  
 .image:hover .mybuttonoverlap{ 
    display:block;
  }
  
  .mybuttonoverlap{
    position: absolute;
    color: #000000;
    background-color: #ffffff;
    border-color: #ffffff;
    border-radius: 30px;
    top: 190px;
    display: none;
  }
   
   .qualquer {
    position: absolute;
      width: 325px;
      top: 87%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 10;
      color: #ffffff;
      text-align: center;
  }


                      


                      

                      

Answer №1

Increase the z-index value higher than what is set for .image::after (which currently stands at 2)

button {
  z-index: 3;
}

View example on jsfiddle

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

Styling Your HTML Background with CSS and Enhancing it with JavaScript

I am lost when it comes to understanding the design of I have spent hours researching how to create backgrounds using shapes and css, but I haven't been successful. Can someone please help me figure out how to create a background similar to . Thank ...

Can you tell me which CSS property is used to display the ellipsis (...) when there is overflow in the x

When the content exceeds the parent's width, the property overflow-x displays a scrollbar. However, I would prefer to show three dots "..." instead of the scrollbar. Is there a way to do this? ...

Conceal CSS Animation overflow content

I've been working on creating an animation, and I'm almost finished with it. The issue I'm encountering is that the horizontal and vertical scrollbars are refusing to disappear. I attempted adding the overflow:hidden property to the parent d ...

A div element springs forth into a new window and seamlessly transitions back to its original position with fresh content

Most of us are familiar with Gmail chat, where you can pop out the chat window into a new window with its content, and then pop it back in to its original position. However, I encountered an issue while working on replicating this functionality. While I w ...

What is the best way to change an HTML string into JSON using PHP?

Is there a method to transform an HTML string into JSON using PHP similar to the functionality of toolslick.com's html2json converter? Here is an illustration of the HTML string: <html> <body> <table style="width: 100%"> ...

To retrieve the id value stored in the database, you can use the onclick JavaScript event within the input tag

I have a piece of code that's successfully working for one function, but I want to approach it differently this time. Here is the code I'd like to use as inspiration: <td> <a href="javascript:edit_id('<?php echo $row[0]; ?& ...

Remove the class upon clicking

I recently created a toggle-menu for my website that includes some cool effects on the hamburger menu icon. The issue I am facing is that I added a JavaScript function to add a "close" class when clicking on the menu icon, transforming it into an "X". Whil ...

Load the iframe element only when the specified class becomes visible within the container div, without relying on jQuery

I am facing a unique challenge where the performance of my page is significantly impacted by loading multiple iframes. These iframes are contained within popup modals, and I would like to delay their loading until a user clicks on the modal. When the mod ...

Having trouble implementing CSS styling on my Django HTML file

I have come across several solutions on this issue but haven't been able to resolve my problem. I am attempting to apply my style.css located in the path \...\static\css. Below is my directory structure as shown in the image here: https ...

Manipulate webpages by opening and closing them with Perl

Looking to automate the process of booking time slots on a website? I want my script to open five tabs in the browser for Monday to Friday bookings. Is there a way to close each tab after completing the booking? Here's an example of what I have writte ...

Google has not detected any hreflang return tag

My website has encountered indexing errors on Google Search Console. According to the reports, many pages are showing an alternate version in a different language without the "return tag". This "return tag" is believed to be the pointer back to the origina ...

Guide to dynamically insert rows in HTML using Vue.js based on the selected option

This is the initial row. Depending on the selection made here, different rows will be displayed <div class="row"> <div class="col-md-4"> <div class="form-group label-floating"> <label class="control-label">Case Type< ...

"Create a web resume that is easy to print and

I'm currently working on implementing a print-friendly feature for a Bootstrap 4 template resume/CV. My goal is to minimize the spacing between sections when the document is printed, allowing users to easily convert it into a PDF or Word format. You ...

Is using Pushstate less effective than Hashbangs for caching purposes?

One of the benefits of using HTML5 Pushstate over hashbangs is that Google now encourages its use. The main disadvantage of Pushstate is that it is not supported by non-modern browsers. However, there seems to be a drawback when it comes to caching as well ...

When there is no visible content on the mobile website, it starts scrolling horizontally to the right

Why is the website scrolling to the right when there is no content there? This issue seems to only occur on actual mobile devices when I try to recreate it. Currently in the process of transferring it over, which is why the link appears as it does. Any ...

Create a stunning MUI App bar with a blurred effect below a fixed Navbar

Is there a method to apply a blur effect to the background of my material-ui AppBar component, creating a visually appealing overlay below the fixed navbar? I have experimented with using filter: blur(0) but it does not achieve the desired result. I am lo ...

Challenge encountered when trying to reference a JavaScript file within an HTML document

I am encountering an issue with two files - TestKeyboard.html and AutomaticKeyboardChange.js. The HTML file looks like this: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ...

Guide on Utilizing Valum's Uploader Demonstration Project

I'm having some trouble getting Valum's Uploader to work. I've tried everything, including extracting the files from the zip and running the demo.htm page in the client folder. But every time I attempt to upload something, it fails. Can some ...

Vuetify - Best practices for vertically aligning rows in a v-treeview component

Just getting started with Vue js, so pardon me if this is a silly question. I've scoured the internet and can't seem to find a solution. I'm working on a v-treeview displaying a folder structure, with descriptions of each folder in a separa ...

Displaying a specific fieldset based on the radio button selection

I have created a form to handle user input using PHP, with the initial question prompting the user to choose from three radio buttons for the "type" parameter - the options being "book", "journal", and "website". Here is what the code looks like: <stro ...