Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在css中设置超链接图像的样式_Html_Css - Fatal编程技术网

Html 在css中设置超链接图像的样式

Html 在css中设置超链接图像的样式,html,css,Html,Css,我正在尝试将锚定标记应用到我已经在css中设置样式的图像,方法是将其向右推(在其包含的div上使用text align:right)并将其大小从400px调整到25px: css: .instagram-section { text-align: right; font-family: 'Life Savers', cursive; font-size: 1em; } .ig-logo { height: 25px; } 但我发现,一旦图像被 玩了一会儿,这似

我正在尝试将锚定标记应用到我已经在css中设置样式的图像,方法是将其向右推(在其包含的
div
上使用
text align:right
)并将其大小从400px调整到25px:

css

.instagram-section {
    text-align: right;
    font-family: 'Life Savers', cursive;
    font-size: 1em;
}

.ig-logo {
    height: 25px;
}
但我发现,一旦图像被


玩了一会儿,这似乎奏效了:

.instagram-section {
    text-align: right;
    font-family: 'Life Savers', cursive;
    font-size: 1em;
}

.instagram-section a img.ig-logo{
    height: 25px;
    display: inline;
}

不知道这是否是最好的方法,所以欢迎更好的答案。

.ig logo,a.ig logo{height:25px;}
?虽然我已经提出了这个建议,但我真的没有在你发布的CSS中看到任何明显的东西会导致你表现出的不同。谢谢,但这似乎对我不起作用。我确实偶然发现了一些有用的东西(总是在发布问题之后!)
<div class="instagram-section">
    <strong>... my <a href="https://www.instagram.com/myinstagram/">Instagram</strong></a>
    <a href="https://www.instagram.com/myinstagram/">
    <img src="/img/icons/instagram/instagram-logo-400.png" class="ig-logo">
    </a>
</div>
.instagram-section {
    text-align: right;
    font-family: 'Life Savers', cursive;
    font-size: 1em;
}

.instagram-section a img.ig-logo{
    height: 25px;
    display: inline;
}