473,387 Members | 1,313 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,387 software developers and data experts.

div:active not working in IE

Atli
5,058 Expert 4TB
Hi.

I have this CSS:
Expand|Select|Wrap|Line Numbers
  1. div.FolderContainer
  2. {
  3.     background: #AFBFAF;
  4.     float: left;
  5.     width: 250px;
  6.     height: 74px;
  7.     border: solid 1px #556555;
  8.     margin: 3px;
  9.     overflow: auto;
  10. }
  11. div.FolderContainer:hover
  12. {
  13.     background: #BFCFBF;
  14. }
  15. div.FolderContainer:active
  16. {
  17.     background: #DFFFDF;
  18. }
  19.  
It's pretty simple, is just supposed to highlight the div on hover and flash it when it is clicked.

This works perfectly in Mozilla, but the :active part wont work in IE. It just stays the same as the :hover part.

Anybody know a way arround this?
May 26 '07 #1
6 19127
drhowarddrfine
7,435 Expert 4TB
:hover does not work on anything but <a> in IE6 while modern browsers can handle anything. There are workarounds using javascript and other workarounds involving placing the <a> element around contents inside the div but it's specific to your application.
May 26 '07 #2
Atli
5,058 Expert 4TB
:hover does not work on anything but <a> in IE6 while modern browsers can handle anything. There are workarounds using javascript and other workarounds involving placing the <a> element around contents inside the div but it's specific to your application.
Ahh, ok.
Weird that :active doesn't work in IE7 tho. I would have thought they'd have fixed it while they were fixing :hover.

Guess I'm gona have to mix in some javascript :(

Thanks for the help tho.
May 26 '07 #3
Atli
5,058 Expert 4TB
Just thought I'd post my solution.
There are many solutions, but this way I wont have to put any part of my styles in the html markup.
And it works in IE5 and never :D (I've tested)

Expand|Select|Wrap|Line Numbers
  1. .TileContainer
  2. {
  3.     background: #AFBFAF;
  4.     float: left;
  5.     width: 250px;
  6.     height: 74px;
  7.     border: solid 1px #556555;
  8.     margin: 3px;
  9.     margin-left: 10px;    
  10.     cursor: pointer;
  11. }
  12. .TileContainerHover
  13. {
  14.     background: #BFCFBF;
  15.     float: left;
  16.     width: 250px;
  17.     height: 74px;
  18.     border: solid 1px #556555;
  19.     margin: 3px;
  20.     margin-left: 10px;    
  21.     cursor: pointer;
  22. }
  23. .TileContainerActive
  24. {
  25.     background: #DFFFDF;
  26.     float: left;
  27.     width: 250px;
  28.     height: 74px;
  29.     border: solid 1px #556555;
  30.     margin: 3px;
  31.     margin-left: 10px;    
  32.     cursor: pointer;
  33. }
  34.  
Expand|Select|Wrap|Line Numbers
  1. <div class="TileContainer" 
  2.     onmouseover="this.className='TileContainerHover'"
  3.     onmouseout="this.className='TileContainer'"
  4.     onmousedown="this.className='TileContainerActive'"
  5.     onmouseup="this.className='TileContainerHover'"
  6. >
  7. </div>
  8.  
May 26 '07 #4
drhowarddrfine
7,435 Expert 4TB
Didn't look at the code because I'm cooking supper but :hover was fixed in IE7. I'll look at the rest in a minute.

Does anyone still use IE5?
May 26 '07 #5
Atli
5,058 Expert 4TB
Does anyone still use IE5?
Yea, his name is Kalaallit and he lives in a lighthouse on a small isle outside of Greenland. He uses his lighthouse to morse the HTML markup from the mainland. Currently hi's IE6 download is at 53%, ETA Jan 2009.
May 27 '07 #6
first of all -> solution works GREAT, even for fuc*ing IE..
i really HATE ie. if you hate it to, go here:

http://ie.jemjabella.com/

seriously.

and hacking your own code, just for sakes of stupid IE - is moronic.
but when you have to.. this is the good solution.

and the post above mine is very funny, ch33rzs :) :) :) :)
ETA 2009, eh? LOL!
Jun 11 '07 #7

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

Similar topics

1
by: abbylee26 | last post by:
<form name="RFO" id="RFO" method="post" action="neworder.asp"> //arow is a hidden field I have made a text field for testing <input name="arow" id="nrow" type="text"> <script...
2
by: DBLWizard | last post by:
Howdy All, I am trying to detect if the user has cookies enabled on a page and display text accordingly. My cookie detection works but I can't get the divs to work. Here is the javascript and...
3
by: boien | last post by:
I have a div container that i have created now i just want to make sure that its horizontally centered in any browser and in any resolution, so that when ever its on 800x600 or 1280x1024 its STILL...
11
by: Benny123 | last post by:
Im very new to the who css lark so am struggling quite a bit. ive managed to build a basic div centred box with css embedded in my html. It looks fine in IE but loses all size in firefox. Any...
1
by: Randell_D | last post by:
Folks, My script below near-works on both Firefox2 and IE7 (though my end user base will be Firefox2 intranet users only)... "near-works" means it does permit me to place my div tag on the screen...
2
by: vijayakumarkb | last post by:
hii everyone i had an empty div to make a division between two divs. i give a height to the div using css like height: 20px; in IE 7 it is showing the height but in mozilla and safari the...
11
by: neovantage | last post by:
Hey all, I have recently started work on div based websites as suggested the great man acoder of this community advise me to learn divs. I made a page using div. In my page i want that content...
0
by: nick259 | last post by:
I am working on a HTML page with a flash animation as my banner and Navigation. My problem is that the flash div hangs over my page and I can't see the top where I need to amend text and headings.I...
1
by: zaxonus | last post by:
Hello, I have had the following problem with Ajax for a few days, and have not been able to solve it even after a few suggestions : - The two files I mention here are copied at the end of this...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.