html - 在 HTML 中的链接前插入 Logo

标签 html css image position

我想在 a 标签前添加一张图片。

<a href="index.html">Apple</a>

例如,在之前添加一个 Apple Logo,但在同一行 Apple 文本中。

谢谢 安德鲁

最佳答案

使用display:flex;warp div来设置aimg

您可以设置 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/

相关文章:

html - Bootstrap 输入尺寸和位置问题

javascript - 按钮在 iPad 中不起作用

php - 使用 ImageMagick 创建类似 placeit.net 的模型?

css - Debug模式打开时的 Django 和静态文件

javascript - 定期更改 css 属性并将该值作为文本添加到 div 中

html - 在我的代码中需要 CSS 定位方面的帮助

javascript - ajax点击功能可以在提交表单时起作用吗?

html - 如何对齐表格内容 HTML 表格

jquery - Zeroclipboard悬停问题

html - 将按钮中的图像与文本居中