#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Anacortes, WA, USA
    Posts
    5
    Rep Power
    0

    css: Why would border display around the margin


    In all my experience with css, I've never had a border be displayed around the margin. The margin is always outside the border while the padding is inside the border.

    What could possibly make it so that the margin is being displayed within the border?

    This problem occurs in all browsers and can be seen around the first thumbnail of paintings near the bottom of the page:

    www.philitopia.net/alicekapka/index.html
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1099
    I believe that's being caused by the whitespace in your HTML source after the <img> and before the </a>. Wrap your image directly in the link.
    Code:
    <a href="foo.php"><img src="foo.jpg" /></a>
    <!-- not -->
    <a href="foo.php">
      <img src="foo.jpg" />
    </a>
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.

IMN logo majestic logo threadwatch logo seochat tools logo