Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts

    :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)

  • #2
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    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)

  • #4
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #5
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    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)

  • #6
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •