Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorgazam
    • CommentTimeJan 14th 2006 edited
     permalink
    Ok, so I was busy at creating my new personal site (also my first) and everything was going fine. IE seemed to be dealing with my Standards Compliant code as well as any other browser, except for maybe one or two small differences. Then I hit a wall...

    Basically, I created a Python cgi script to display the latest, most interesting images from flickr on my blog page... this is where it all went downhill. The funny thing is, IE deals with 'img' tags inside 'a' tags like I had expected firefox, opera etc. to handle them and firefox and co. render incorrectly!

    I've created a page to demonstrate the desired look of the image links, including the css... image test.

    In IE, the 'a' element wraps around the image fully, perfect! In firefox and others the link seems to cover the whole image, but applying a border to the 'a' element quickly shows that it's oddly positioned at the bottom of the image, completely destroying the desired effect (note: I want the :hover part to function in all browsers, and since IE will only use :hover when used with an 'a' tag I can't do it any other way... even a:hover img { doesn't work in IE).

    I'm a linux user, so I'm certainly not an IE fan, but this surprised me quite a bit. Any help on the matter is greatly appreciated.

    Gareth
    •  
      CommentAuthormringlein
    • CommentTimeJan 14th 2006
     permalink
    In IE, both of your examples work -- in FF only your second example works. However, if you apply the style to 'a img' and 'a:hover img', then you get it to work. Why only apply it to the a element? That is why it is showing at the bottom; you need to apply the style to the 'a img'
    • CommentAuthorgazam
    • CommentTimeJan 14th 2006 edited
     permalink
    In IE, both examples look the same, but on the second one the :hover function doesnt work... I'm not really sure what you mean though, as if what you're basically just telling me CSS that I'm using for the 'works in firefox' example already and which doesn't work fully in IE.

    By the way, thanks for such a fast reply.
    • CommentAuthorspyyddir
    • CommentTimeJan 14th 2006
     permalink

    a {display: block;}


    or, to replicate the exact effect


    a {display: block; float: left;}
    img {float: left;}
    • CommentAuthorgazam
    • CommentTimeJan 14th 2006
     permalink
    Hey spyyddir, that worked, thank you! I actually tried display: block before, but it then made each image take up a whole line in the sidebar... I wanted two. I completely forgot about float: left, which should fix that issue. How stupid of me.

    Anyway, thank you both for the replies. I'm gonna go fix the css for the actual site now, and I'll post a link as soon as it's done.
  1.  permalink
    Yeah.

    In your first example, your <a> tag expects text (and is showing the default line-height + padding) because it's inline-level element.

    If you display block it to the dimensions of your image, it should work just fine.
    • CommentAuthorgazam
    • CommentTimeJan 14th 2006
     permalink
    Ok, so I changed my main page accordingly, and the boxes now work fine. Although now IE renders a big gap between the title and the box... Firefox and co render it fine now though. Check it out at link.

    So at least it's getting there. I am pretty sure the floating has caused this issue. I've used an empty p tag at the bottom of the box with 'clear: left;' in order to get the box to reach below the pictures, which is now working fine in firefox etc.

    I'm repeating myself now, so just check it out if you want and again, any help is appreciated.
    • CommentAuthorspyyddir
    • CommentTimeJan 15th 2006
     permalink
    Looks nice, well done.
Add your comments
    Username Password
  • Format comments as (Help)