CSS transition across different browsers

I'm encountering an issue with the code provided below

Here is my stylesheet

.h_w:hover img{
    -webkit-transform: scale(1.1); 
         -moz-transform: scale(1.1); 
          -ms-transform: scale(1.1);
           -o-transform: scale(1.1);
              transform: scale(1.1);
    -webkit-transition: 5s all;
       -moz-transition: 5s all;
         -o-transition: 5s all;
        -ms-transition: 5s all;
            transition: 5s all;
}
.h_w{ border-radius:200px;
       -moz-border-radius: 200px;
        -ms-border-radius: 200px;
         -o-border-radius: 200px;
    -webkit-border-radius: 200px;
    height: 287px;
    overflow: hidden;
    position: relative;
    width: 287px;
    background-color: #FFFFFF;
}    
.opacity-0.5{opacity:0.2;}
.circle_background{ 
    background:url(../images/circle-bg.png) no-repeat; 
    height:100%; 
    width:100%;
    position:absolute;
    font-size:15px;
    opacity:1 !important;
    top: 286px;
}    
.h_w:hover .circle_background{
            transition:1s all;
       -moz-transition:1s all;
        -ms-transition:1s all;
         -o-transition:1s all;
    -webkit-transition:1s all;
    top:0px;
    z-index:1000px;
}

In addition, here is my HTML snippet

<body style="background-color: #000000;">
    <div class="h_w">
        <span><img src="images/projects/circles/background.png" alt="flick the switch" /></span>
    </div>                
</body>

While this code functions correctly in Mozilla Firefox, I am facing a problem in Chrome where zooming causes it to extend beyond the circle.

Your assistance on this matter would be greatly appreciated.

Answer №1

Get your answer right here: --->X<---

By the way, make sure to include

-webkit-mask-image: -webkit-radial-gradient(circle, white, black);
in the styles of the parent div of your image. I hope this information is useful for you.

Answer №2

Try using this specific code for the desired effect.

.h_w:hover img {
        -webkit-transform: scale(1.1);
            -moz-transform: scale(1.1); 
            -ms-transform: scale(1.1);
            -o-transform: scale(1.1);
            transform: scale(1.1);
        -webkit-transition: 5s img;
            -moz-transition: 5s img;
            -o-transition: 5s img;
            -ms-transition: 5s img;
                transition: 5s img;        
}

In the code above, notice that the .h_w:hover img rule utilizes the transition property. When using the transition property, specify "img" to apply motion solely to images and not all elements. Therefore, replace "all" with "img". Hope this helps!

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's Causing the Truncation of Footer Designs?

In the footer, I have some social media links that are styled to appear as circles: While everything looks great on Chrome, I've noticed an issue on Safari where the last link seems to be getting "cut off", and I'm struggling to identify the cau ...

HTML - Customizing container with background color and ensuring minimum height of 100%

After creating a dynamic page using Bootstrap, I managed to add a sticky nav bar and footer. The navbar, footer, and page content are all in black color. I want the main content area to be white with black sides matching the background. Currently, I ca ...

Strategies for making a child div fade out when the parent div is hovered over

I have a div with the class name ordershape and inside it, there is another div called fad-res. My goal is to display the corresponding fad-res when I hover over a specific ordershape, while hiding the other divs. <div class="ordershape"> & ...

Learn how to implement the JQuery ReplaceWith function with the resources provided by materials.io icon

I would like the favorite_border icon to switch to the favorite icon when clicked. As we are using material.io and both icons have the class material-icons, I am unsure about how to implement this using jQuery. What steps should I take to achieve this? (w ...

What are some ways to replicate the experience of a lengthy document loading?

I am interested in conducting tests on JavaScript code that runs both before and after the document is fully loaded. Is there a way to purposely delay my document's loading process (for instance, by 10 seconds) so I can easily observe the effects occ ...

The Outer Div Can't Contain Google Maps

I am currently working on integrating a map widget into a dashboard I created using gridstack.js. The sample widget layout that I am aiming for can be seen in the link below: https://i.sstatic.net/ZQP6G.png My goal is to embed the map within the inner (w ...

Is it possible to save an entire webpage that infinitely scrolls without actually manually scrolling through it?

I'm dealing with a webpage that has infinite downward scrolling. I tried automating the scrolling, but eventually the page became too large to continue scrolling. To fix this, I manually removed some DIV blocks from the source code which decreased the ...

Remove the opacity setting from a transparent box that covers the entire page

I find that real code tends to be more complex, but this snippet does a good job of highlighting the issue at hand. In my setup, there's a background video playing (in this case, just as the background), and on top of that sits a transparent watch fa ...

Tips for creating a form with recurring elements efficiently

Currently struggling to summarize the issue at hand with a simple title, so here's the detailed explanation: Imagine I'm inputting information for multiple contacts, and there are various fields involved: Name of the contact Method of Contact ...

Display HTML instead of text in print mode

Hello, I need help with printing HTML code, specifically an iframe. When I try to add my HTML iframe code, it only prints as plain text. I want to be able to see the actual iframe with its content displayed. Thank you. <script> const messages = [&apo ...

Is it feasible to utilize a CSS variable within a CSS "background URL" property?

Having trouble setting a base domain for all my pictures in a CSS file. Here's what I've tried: In global.css: :root { --bgd: #C0C0C0; --picdomain: "https://somedomain.com/"; } In s1.css: @import url("global.css"); body { background-co ...

Toggling a div overlay through various user interactions such as clicking, pressing a button, or hitting the escape

I've created a simple div overlay that appears when a user clicks inside an input box: HTML <html> <body> <input id="search" type="text" placeholder="Search..."> </body> </html> CSS #overlay { position: fixed; ...

The alignment of the image on a mobile device appears to be off

I've been trying to center an image on my website, and it looks perfect when viewed on a desktop computer. However, when I load the page on a mobile phone browser, it appears a bit off. This is the CSS code I'm using to center the image: #logo ...

How to make a div expand to full width using CSS animations

Issue with Div Animation I am currently facing an issue where I am trying to animate a div to expand to 100% of its child's width on hover. However, the animation is not working smoothly as expected. Instead of gradually expanding to the right, the d ...

Displaying a dynamic progress bar across all elements in fullscreen mode

I am looking to implement a full-screen indeterminate progress bar that overlays all screen elements. Here is my specific use case: When a user fills out a form, including an email field, the email id is checked against a database via ajax. While waiting ...

What is the most efficient method for incorporating fonts.googleapis.com into CSS files for use on both HTTP and HTTPS pages?

My website functions correctly when accessed through URLs that start with either http:// or default to the http protocol if not specified. However, an error occurs stating that the main.css file cannot be found when the URL begins with https://. The lates ...

Is it feasible to submit a request without needing to redirect the page or relying on JavaScript?

I am attempting to send a post request to an API. This is what I have so far: <form method="POST" action="/api/updoot/ID:{{ post.ID }}"> <input type="submit" value="updoot"/> </form> Upon clicking submit, it redirects. While I can p ...

Tips for ensuring compatibility of CSS in IE7 and IE8

Despite using the following styles to dynamically display alternative colors in my HTML code, I am facing compatibility issues with IE7 and IE8. Surprisingly, everything works perfectly fine on IE9 and above. It seems these styles are not supported by IE7 ...

Customize URL based on selected button

My question may be a bit unclear, but I want to generate dynamic URLs that redirect users to specific pages based on the link clicked. For example: Parent page with links (a, b, c, x, y) User clicks on 'b' User is taken to a Node Page that play ...

Tips for displaying the contract form as text within an iPad app

Looking to develop an iPad application that includes a form for users to enter their name and date, with other fields already hard coded as shown in the example form. Which control should be used to achieve this functionality - is a TextView or webView mor ...