我想在 a 标签前添加一张图片。
<a href="index.html">Apple</a>
例如,在之前添加一个 Apple Logo,但在同一行 Apple 文本中。
谢谢 安德鲁
最佳答案
使用display:flex;
来warp div
来设置a
和img
行
您可以设置 align-items: center;
使文本居中
了解 flex
:https://www.w3schools.com/cssref/css3_pr_flex.asp
.warp{
display:flex;
align-items: center;
}
img{
height:150px;
width:150px;
}
<div class="warp">
<img src="https://material.angular.io/assets/img/examples/shiba1.jpg"/>
<a href="index.html">Apple</a>
</div>
关于html - 在 HTML 中的链接前插入 Logo ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50782641/