我的网站有以下代码,我正在尝试向网页上的图像链接组添加填充
<ul class="">
<a href="https://www.github.com">
<img style="height:auto; width:auto; max-width:50px; max-height:50px;" src="images/github.png" border="0" alt="Code" class="">
</a>
<a href="http://www.linkedin.com">
<img style="height:auto; width:auto; max-width:50px; max-height:50px;" src="images/linkedin.png" border="0" alt="Connect" class="">
</a>
<a href="https://www.twitter.com">
<img style="height:auto; width:auto; max-width:50px; max-height:50px;" src="images/twitter.png" border="0" alt="Twitter">
</a>
</ul>
我还有以下 CSS:
a{
color:black;
text-decoration: none;
margin: 0px auto;
width: 400px;
}
ul{
padding: 0;
}
要在我的网站的群组图片链接上添加垂直填充,我需要做什么?
最佳答案
不确定这是你想要的,但尝试使用 padding-top
:
ul a img {
padding-top: 10px; /* Change the value according to your needs */
}
顺便说一句,您应该为您的元素赋予类以更具体地定位它。
关于html - 如何将上填充添加到一组链接图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21656042/