In FireFox, image style is discarded when inserted within anchor tag in search page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kalpana Durairaj
    New Member
    • Sep 2008
    • 4

    In FireFox, image style is discarded when inserted within anchor tag in search page

    I want to insert my image within search result anchor(say google search results).
    <a href="http://www.codeproject .com">Code Project <!-- Google search result link-->
    <img src="myimage.pn g" style="text-decoration:none "/> - My Code
    </a>

    Used javascript to parse the google search page, collect search results and to insert the above said image.
    In IE, the image was displayed without underline as we applied textDecoration style as none. Whereas in FireFox 2.0/3.0, it was displayed with underline.

    If we apply textdecoration style as none to search result anchor, both search text and image is not underlined.
    We believe that our image element is inheriting the anchor styles.

    We tried the above html code in a prototype and it works fine. Problem occurs only when u do with the search page in FF.

    Pls. let me know your thoughts on fixing this problem.

    Thanks in advance.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    The anchor is an element surrounding both the text and the image. You are trying to apply the CSS to the image only. IE is incorrect as always.

    Comment

    • Kalpana Durairaj
      New Member
      • Sep 2008
      • 4

      #3
      In IE, the image is displayed without underline. This is the expected behaviour.
      Only in FF, the image is displayed with underline. Any ways to get rid of this and to get the same behaviour in FF as in IE.

      Thanks.

      Comment

      • Kalpana Durairaj
        New Member
        • Sep 2008
        • 4

        #4
        Found the solution.

        Set the background-color style as white for image element surrounded within anchor. So that the image will not be underlined in FF.

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          Originally posted by Kalpana Durairaj
          In IE, the image is displayed without underline. This is the expected behaviour.
          Expected by who or what? IE is incorrect in this. FF is performing according to the standard. Never, ever use IE as a reference for how things should work. It is 10 years behind web standards the worst browser implementations on the planet.

          Comment

          • Kalpana Durairaj
            New Member
            • Sep 2008
            • 4

            #6
            Originally posted by drhowarddrfine
            Expected by who or what? IE is incorrect in this. FF is performing according to the standard. Never, ever use IE as a reference for how things should work. It is 10 years behind web standards the worst browser implementations on the planet.
            Yes, i agree with what u said. Really i don't know which should be the correct behaviour. Was looking from the point that why certain style works in IE and not in FF. Based on that, quoted the behaviour.
            Finally we decided to drop inserting image in search text anchor due to some other issues.
            Thanks.

            Comment

            Working...