css - 如何在 Tumblr CSS 上链接固定图像?

标签 css image hyperlink linker tumblr

对于我的 Tumblr 主题,我希望将屏幕右侧的这 4 个固定图像链接到另一个页面。

My Tumblr's link .

这是其中一张图片的 HTML:

<img src="http://i851.photobucket.com/albums/ab71/rachelala101/fandomsbuttons1-1_zps43ab3b55.png" id="icon1" width="90px">

这是它的 CSS:

#icon1 {
    display:block;
    position:fixed;
    right:20px;
    top:60px;
    z-index:130
}

我尝试使用标签链接它,但随后图像完全消失了。

最佳答案

欢迎来到 StackOverflow,

您应该像您提到的那样使用标记 anchor a 。这是一个工作示例,将 # 替换为您的链接。

<ul>
    <li><a href="#"><img src="http://i851.photobucket.com/albums/ab71/rachelala101/fandomsbuttons1-1_zps43ab3b55.png" id="icon1" width="90px" class="icon1_rollover"/></a></li>
    <li><a href="#"><img src="http://i851.photobucket.com/albums/ab71/rachelala101/fandoms%20buttons%201-1-2_zpsynh4farl.png" id="icon2" width="90px" class="icon2_rollover"/></a></li>
    <li><a href="#"><img src="http://i851.photobucket.com/albums/ab71/rachelala101/fandomsbuttons1-3_zps10c8734d.png" id="icon3" width="90px" class="icon2_rollover"/></a></li>
</ul>

CSS

ul {
    list-style: none;
    position:fixed;
    right:20px;
    top:60px;
    z-index:130;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration:none;
}

您可能想阅读此 tutorial .

顺便说一句,博客不错。

关于css - 如何在 Tumblr CSS 上链接固定图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28094034/

相关文章:

html - <tr>-边框没有出现在 outlook 中

jQuery this() 循环问题

iphone - 带动画的电子邮件图片

java - 旋转图像,图像宽度和高度不均匀

windows - 如何删除文件以及 Windows 上的所有硬链接(hard link)?

javascript - 背景大小的jquery CSS多个值

java - 与其他工具相比,从 Java 中的 BufferedImage 获取的 RGB 值不正确

PHP 和 MySQL - 整个表列需要链接而不是纯文本

javascript - 确定请求是通过浏览器书签/收藏夹还是链接?

CSS - 并排 float 两个元素