Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Hidden properties for img tags and a tags?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28508
    chrisbeaman
    Member

    I encountered something weird this morning. Here’s my code:

    Code:

    So basically both the img and the a tag are block-level elements given the same width and height. The image is floated left whereas the anchor is not. But yet the anchor winds up behind the image.

    This is what it looks like: http://www.chrisbeaman.com/test1.html

    What’s weird is that when I move the float from the image to the anchor and then switch the order of the anchor with the image in my HTML, the anchor now properly floats left and the image displays to its right. Here’s the code:

    Code:

    And here’s the result: http://www.chrisbeaman.com/test2.html

    Why is this? Since they both have the same width and height and are both block-level elements, shouldn’t they behave the same way? Or is there some hidden property that distinguishes a tags and img tags, or elements with background images or otherwise?

    #73113
    chrisbeaman
    Member

    Anyone?

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.