IMG Tag Remove Border

后端 未结 4 1732
不知归路
不知归路 2021-01-02 14:28

http://www.flirtwithme.co/main.php#upgrade

On this page there is a blue box image that has a grey border around it. I\'ve been trying to remove the border without lu

4条回答
  •  执笔经年
    2021-01-02 15:01

    There's no point using an > tag if you're going to use CSS background for the image. In an tag the src attribute is used to specify the foreground image, and it is a mandatory attribute for this tag. Leaving it out will have unexpected results, such as the border effect you're seeing, but this may vary from browser to browser.

    If you want to use CSS background-image, just use a different HTML tag (eg

    ).

    If you want to use an tag then you need to use the src attribute, and not define it in CSS.

    The point here is semantics. An image in an tag is assumed to be part of the content of the page, hence the image is specified in the HTML code, whereas by defining an image in CSS, you are saying that it is part of the design, and not content.

    You should use the method which matches the purpose of your image in the site.

提交回复
热议问题