Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

?
Lv 4

HTML Border on image is huge?

This is a CSS question.

Why does my image have so much padding? I want the border to touch the img. What am I doing wrong?

This is the CSS script:

div.img {

border:10px solid blue;

padding:0px;

}

Update:

The image doesn't have any styles. This is the html code for the image. This should be very simple to do.

Update 2:

2 Answers

Relevance
  • Anonymous
    9 years ago
    Favorite Answer

    try just .img instead of div.img

    Looks like you are giving both the div and the image a border of 10px equaling 20px.

  • 9 years ago

    Are you useing a class img on the image tag?

    Try

    div .img{

    border:10px solid blue;

    }

    If there is no class on the image tag try to remove the period

    div img{

    border:10px solid blue;

    }

Still have questions? Get your answers by asking now.