html - 当我制作超链接时,我的图像格式变得疯狂
问题描述
寻找关于我的社交偶像为什么这样做的建议。以前没遇到过这个问题。我假设其他一些 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;
}
解决方案
<a>
标签是display: inline;
默认的。<a>
将包含您的图标显示属性的标签更改为display: inline-block;
推荐阅读
- c++ - 为什么 new 表达式可以正确生成指针类型,即使它应该返回 void*?
- markdown - 一些 Sublime 包,例如 MarkdownEditing,会根据语法将它们的命令隐藏在命令面板中。有没有办法覆盖这个?
- animation - 有人可以分享一个当前的 SpriteKit 纹理图集样本来分解吗
- nested - 似乎无法在短代码中嵌套 php 变量
- javascript - 在Javascript中计算RGB颜色块平均值的更有效方法
- java - Android:碎片内存消耗
- javascript - ReactJS - 将对象传递给动作时出错
- python - 在列表中删除“NaN”和单引号项
- javascript - 如何仅使用 javascript/ajax 或 jquery 注册用户
- pandas - 需要一种将字符串 pandas 拆分为带有数字的列的方法