473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to posibal image hover effect another image ?

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style type="text/css"> 
  5. div
  6. {
  7.  
  8. background:url(banner.jpg);
  9. transition:width 2s;
  10. -moz-transition:width 2s; /* Firefox 4 */
  11. -webkit-transition:width 2s; /* Safari and Chrome */
  12. -o-transition:width 2s; /* Opera */
  13.  
  14. }
  15.  
  16.  
  17. div:hover
  18. {
  19. background:url(banner.jpg);
  20. }
  21.  
  22.  
  23. </style>
  24. </head>
  25. <body>
  26.  
  27.  
  28.  
  29. <div></div>
  30.  
  31.  
  32.  
  33. </body>
  34. </html>
  35.  
Aug 5 '12 #1
6 2312
ariful alam
185 100+
R you trying to create a background image change on hover? if yes then your writings has a little error. you used same image in div and div:hover css settings. you should use different image for div and div:hover css settings. moreover your div css settings has no width and height settings. so the div will not have a sized defined to show the background image in browser. you should use a width and a height for the div.

here is the changed code:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style type="text/css"> 
  5. div
  6. {
  7.    width:500px;
  8.    height:150px;
  9.    background:url(banner1.jpg);
  10.  
  11.    transition:width 2s;
  12.    -moz-transition:width 2s; /* Firefox 4 */
  13.    -webkit-transition:width 2s; /* Safari and Chrome */
  14.    -o-transition:width 2s; /* Opera */
  15. }
  16.  
  17. div:hover
  18. {
  19.    background:url(banner2.jpg);
  20. }
  21. </style>
  22. </head>
  23. <body>
  24.  
  25. <div></div>
  26. </body>
  27. </html>
Aug 5 '12 #2
now in hover to add unorder list also?can it possibal?
Aug 6 '12 #3
ariful alam
185 100+
@sharmahemal:

sorry, don't get what about you are asking. can you explain please.
Aug 6 '12 #4
Expand|Select|Wrap|Line Numbers
  1. div:hover
  2. {
  3.    background:url(banner2.jpg);
  4. <ul>
  5. <li>fgg</li>
  6. <li>fgg</li>
  7. <li>fgg</li>
  8. </ul>
  9. }
can it possibal? so please give me some refrence
Aug 6 '12 #5
ariful alam
185 100+
you are trying to add HTML tags on hover. that's not possible.

but you can do this kind of works using JavaScript like some hidden div can be shown by hovering on some other div.
Aug 6 '12 #6
ariful alam
185 100+
you are trying to add HTML tags on hover. that's not possible.

but you can do this kind of works using JavaScript like some hidden div can be shown by hovering on some other div.
Aug 6 '12 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Laszlo Zsolt Nagy | last post by:
I would like to load image from a directory right into an image list. I wrote a simple library that loads the images in the directory and resizes them as needed before adding to the wx.ImageList....
12
by: CJM | last post by:
Is it possible to achieve a hover effect for a non-anchor tag in CSS? I can use the following code, but it goes against the grain: <a href="" onclick="return false;">Label</a> Surely there...
51
by: madsgormlarsen | last post by:
I can not get hover effect on a TD to work in IE, it seams you can not have a hover on a td in IE? I have treid this body.section-2 td.current, body.section-2 td.submenu, body.section-2...
13
by: windandwaves | last post by:
Hi Folk Just a bit of help here for newbies who want their menus to look nicer. I am sure that many of you make menus like this <ul id="menu"> <li><a href="page1.html">option 1</a></li>...
3
by: jack | last post by:
Hi im making a scheduler, in house project in which im using a calender control. in this is possible to ger an hover effect (or a color change ) of a cell which i do mouse over on this control . ...
3
by: jack | last post by:
Hi.. aaa... i tried a lot btu couldnt find on net, Im trying to get the hover effect of the web button . but dont know how to get this .. Please help Thanks Awaiting for the answer..
10
by: tomasio | last post by:
Dear Pros, How can I achieve a nicer hover-effect for the image tomasio.design on the bottom-right of my webpage? I am using the class ".footer a:hover" for a CSS-based mouseover-effect but this...
1
by: tomasio | last post by:
Dear Pros, How can I achieve a nicer hover-effect for the image "tomasio.design" on the bottom-right of my webpage? I am using the class ".footer a:hover" for a CSS-based mouseover-effect but...
1
by: rupak | last post by:
I have an mouseover effect with css on hover, which change the image on hover through Css. It works with IE fine but have problem with Mozilla, as the background image not coming full on hover. If...
4
by: romepatel | last post by:
I am using <div class="abc"> and I have abc:hover{ } in my style.css file, The hover effect don't work in IE 6. Though it works fine in IE 7 and firefox.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.