首页 > 解决方案 > 当我制作超链接时,我的图像格式变得疯狂

问题描述

寻找关于我的社交偶像为什么这样做的建议。以前没遇到过这个问题。我假设其他一些 css 会影响它,但我无法在任何地方找到它。

希望这些图像的格式在它们是链接时改变并且希望。

我敢肯定有一个简单的快速修复......我很想念它,感谢您查看这个。

<div id = "socialcontainer">
    <A HREF = ""><IMG class = "socials" SRC = "icons/FB.png"></IMG></A>
    ><IMG class = "socials" SRC = "icons/insta.png">
    <IMG class = "socials" SRC = "icons/SC.png">
    <IMG class = "socials" SRC = "icons/YT.png">
    <IMG class = "socials" SRC = "icons/BIT.png">
  </div><!--socialcontainer -->

    #socialcontainer{
  width:270px;
  padding-top:35%;
  left:80%;
  //position:sticky;
  //text-align:center;
  //border-style: solid;
  //border-color: red;
  z-index: 1;
  display:block;
  margin:auto;
}
.socials{
  width:50px;
  float:left;
  display:inline; 
  text-align:center;
  border-style: solid;
  border-color: red;
}

A:not(img){
  color: inherit; /* blue colors for links too */
  text-decoration: inherit; /* no underline */
}

/*a img{
  width:inherit;
  margin:inherit;
  padding:inherit;
  display:inherit;

}*/

a:not(img):hover {
  color: #7d0505;
}

截屏

标签: htmlcssanchor

解决方案


<a>标签是display: inline;默认的。<a>将包含您的图标显示属性的标签更改为display: inline-block;


推荐阅读