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 8647539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:05:53+00:00 2026-06-12T13:05:53+00:00

The following code shows the image in the div tag. <div class=’item’> <img class=’img’

  • 0

The following code shows the image in the div tag.

<div class='item'>
        <img class='img' src="image1.png" alt="" />
</div>

I am using the following css to add effects to the html image code:

img{
width:50px;
height:50px;
opacity:0.4;
filter:alpha(opacity=40);

}

img:hover{
opacity:1.0;
filter:alpha(opacity=100);
}

I am using this to have opacity effects in css. With this code, the opacity effect works well when I hover over the image itself. But how do I make it so that the opacity effect on the image occurs when I hover over the div tag instead. I want to be able to hover over any part of the item div which encapsulated the image, to get the change opacity effect on the image. NB effect on just the image not the entire div. Can this be done in css? If so how?

  • 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-12T13:05:54+00:00Added an answer on June 12, 2026 at 1:05 pm

    Change this:

    img:hover{
    opacity:1.0;
    filter:alpha(opacity=100);
    }
    

    to

    .item:hover img{
    opacity:1.0;
    filter:alpha(opacity=100);
    }
    

    This will change the opacity of the img when the div is in hover state.

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

Sidebar

Related Questions

I have the following code: <div class=outer-div> <img onmouseover=showDiv(this) src={{ STATIC_URL }}/images/user_male.png> <a onmouseout=hideDiv(this)
I have the following code: <div style=width: 150px> <div style=padding: 5px> <img src=http://xenforomods.info/styles/Silent/xenforo/browser/announcementIcon.png width=50px
I have to image with the following code: echo '<div class=thumb style=width: '.$array['thumb_width'].'px; height:
Im using the following code <script src=http://code.jquery.com/jquery-latest.js></script> <script> //Document ready $(document).ready(function(){ //Show info $('a.getinfo').live(click,
I have the following code where the image is higher than 44px: <div style=width:300px;display:-ms-grid;-ms-grid-rows:44px
The following is the structure of the code of my website. <body class=xxx> <div
I have the following HTML code: <div style=background-image:url(~/Images/MyImage.jpg); width:100%; height:100%> I'm not too familiar
The following code shows a button that allows you to select a file (should
The following code shows 1 view, 1 partial view, and 1 controller . The
The following code shows what I currently have. It is an adapter for circular

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.