gpt4 book ai didi

css - WP - 无法设置框样式或加载图片?

转载 作者:太空宇宙 更新时间:2023-11-04 15:23:20 24 4
gpt4 key购买 nike

在此website我需要添加指向 google+ 和 Facebook 的链接。我无法获得使 div 框生效的 CSS。我也尝试用 img 标签添加图片,但我无法加载图片,即使它似乎是正确的目录并且其他图像具有相同的目录。我想将 2 个图标添加到菜单栏的右侧。

HTML:

<div class="art-nav">
<ul class="art-menu">
<?php art_menu_items(); ?>
</ul>
<div id="facebooktopmarc">
<a href="https://www.facebook.com/raadmal">
<img src="images/facebook.png" alt="Go to Facebook!"/>
</a>
</div>
<div id="googleplustopmarc">
<a href="https://www.facebook.com/">
<img src="images/google-plus.png" alt="Go to Google-plus!"/>
</a>
</div>
</div>

CSS:

#facebooktopmarc {
background-image: url("images/facebook.png");
background-position: right center;
background-repeat: no-repeat;
display: block;
float: right;
height: 25px;
margin: 0 5px 0 0;
position: relative;
width: 25px;
}

#googleplustopmarc {
background-image: url("images/google-plus.png");
background-position: right center;
background-repeat: no-repeat;
display: block;
float: right;
height: 25px;
margin: 0 5px 0 0;
position: relative;
width: 25px;
}

最佳答案

CSS 中的 Urls 与这个 CSS 文件在文件系统中的位置相关。如果要在 html 中使用 img,则应使用相对于此 html 的路径或带域名的绝对路径。

你的图片有 url

http://raad-mal.dk/wp-content/themes/green_room/images/facebook.png
http://raad-mal.dk/wp-content/themes/green_room/images/google-plus.png

关于css - WP - 无法设置框样式或加载图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14329298/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com