html - 我在主页上找不到我的链接

标签 html css hyperlink

我无法找到我的链接。当我打开文件中的 html 和 css 时,我看不到它(我相信它卡在我的 div 下,即使 z-index 更高?)我不完全确定为什么,任何帮助将不胜感激!

HTML:

<!DOCTYPE html>
<html>
<head>
    <link type="text/css" rel="Stylesheet" href="Stylesheet.css" />
    <title>Derpycats.com</title>
</head>
<body>

    <!--Background (Carbon Fibre)-->
    <body background="background.jpg" alt="Background" />

    <!--Header-->
    <h1 id="header">DerpyCats.com</h1>
    <div id="headerdiv"></div>

    <!---Links-->
    <a href="http://www.youtube.com">Home</a>

</body>
</html>

CSS:

/* Sets the pixel density to "fill browser" */
* {
    width: 100%;
    height: 100%;
}

/* Heading */
#header {
float:left;
margin-left: 5px;
padding-top: 5px;
font-size: 16px;
font-family: Verdana, sans-serif;
color: #D9411E;
z-index: 2;
position: fixed;
font-size: 50px;
bottom: -50px;
}

/* CSS for the heading div */
#headerdiv {
border-radius: 5px;
z-index: 1;
position: fixed;
width: 99%;
margin-top: -20px;
height: 100px;
background-color: white;
margin-bottom: 10px;
}

/* Css for the links */
a {
    z-index: 3;
    font-family: Verdana, sans-serif;
}

/* CSS for the normal paragraphs */
.paragraph {
color: white;
font-family: Courier, serif;
}

附言我不认为这很重要,但我在 OSX 上使用 sublime text 2。

最佳答案

我不明白你想做什么,但是 #headerdiv 覆盖了你的链接。

您可以将 z-index = -1 值赋给您的 #headerdiv 以将其发回。

关于html - 我在主页上找不到我的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26566530/

相关文章:

html - 无法用鼠标控制下拉列表

java - Spring-通过链接传递参数

php - CSS 类未在链接上设置预期的颜色

java - 如何将行添加到包含 java 中的 mailto 链接的文本区域?

html - 我怎样才能使这个点与文本的基线垂直对齐?

css - 带有 overflow hidden 的内联 div

html - 是否可以为 html 电子邮件创建垂直文本方向?

html - 使列表项可点击 (HTML/CSS)

css - 在 React App 中使用 CSS/SCSS 模块的便捷方式

javascript - 使用 Flexbox 时 Apex 图表无法正确调整大小