Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-22-2004, 02:31 PM   PM User | #1
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
:hover CSS for image element

Hi , if you look at this in Moz... http://www.firepages.org/ch/
when you mouseover the images the border changes colour...

In IE(6) this does not happen , is this something that IE can't do or am I just doing it totally backwards ?

the CSS I use is ...


.fpa_ex_t_img{width:50;height:50;border:solid 1px black;float:left;margin-bottom:10px;margin:5px;}
.fpa_ex_t_img:hover{width:50;height:50;border:solid 1px gold;float:left;margin-bottom:10px;margin:5px;}

if it can't be done via CSS do you have any javascript alternatives/common workarounds ?

Also , I want (on another similar page) to set the border-color of the image inline (as its dynamically generated [I dont want to rebuild the css file on every request]) , when I do that the :hover above does not work in mozilla nor IE ... can I set :hover inline and if so how ?

cheers !
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Old 02-22-2004, 02:47 PM   PM User | #2
me'
Senior Coder

 
Join Date: Nov 2002
Location: Warwickshire, England
Posts: 1,229
Thanks: 0
Thanked 0 Times in 0 Posts
me' is an unknown quantity at this point
Remember: IE can't handle :hover on anything other than <a> tags. See this for a possible solution.
__________________
David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!
me' is offline   Reply With Quote
Old 02-22-2004, 03:26 PM   PM User | #3
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
Quote:
Remember: IE can't handle :hover
I could not remember cos I did not know , the last time I thought/bothered about presentation was when hover was IE only ! so I was kinda shocked to see it work in Moz but not IE ~

anyway your link has my first issue sorted !cheers!

any ideas about the second ? putting hover inline ? or forcing overwriting an inline style for hover ?
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Old 02-22-2004, 04:00 PM   PM User | #4
me'
Senior Coder

 
Join Date: Nov 2002
Location: Warwickshire, England
Posts: 1,229
Thanks: 0
Thanked 0 Times in 0 Posts
me' is an unknown quantity at this point
Quote:
Originally posted by firepages
any ideas about the second ? putting hover inline ? or forcing overwriting an inline style for hover ?
You can put hover inline styles, but you shouldn't use inline styles at all (mixing of content and style). How are you dynamically generating this image? Are you writing the actual <img/> tag code? If so, add a class to it and define this class in the CSS document.
__________________
David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!
me' is offline   Reply With Quote
Old 02-22-2004, 04:39 PM   PM User | #5
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
cheers again dude , that link fixed me up .. I always get frustrated trying to find what I want on that site ~

I know that stricktly speaking , I `should not` be using inline styles , however the thumbnail images in question [not the ones in htat sample page] are created dynamically and require a border colour that is decided at runtime , this means that I could parse the css file as PHP , and add the appropriate styles there , this however gives me caching issues plus defeats the point of having a cached stylesheet in the first place.

By putting the style inline I get no stylesheet caching issues & it simply works (well it does now cheers!)
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Old 02-22-2004, 05:55 PM   PM User | #6
me'
Senior Coder

 
Join Date: Nov 2002
Location: Warwickshire, England
Posts: 1,229
Thanks: 0
Thanked 0 Times in 0 Posts
me' is an unknown quantity at this point
*sigh*

Ah, for CSS variables set on the fly...

Maybe one day.
__________________
David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!
me' is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:13 AM.


Advertisement
Log in to turn off these ads.