锚链接不可点击

问题描述 投票:0回答:1

我在 wordpress 上有一个简单的博客 http://heather.stevenspiel.com/ 我正在尝试将标题标题设为主页的链接。我进入 header.php 并重写了该部分的脚本,但仍然无法获得工作链接。

这是我重写的:

<h1>
   <a href="http://heather.stevenspiel.com/" style="cursor:pointer !important;">My Spiel</a>
  <br/>&nbsp;
</h1>

我知道由于CSS颜色变化,href正在被注册。

这就是之前的代码:

    <h1>
        <?php
            if ($balloons_option['balloons_site-title_line1'] == '' && $balloons_option['balloons_site-title_line2'] == '') { ?>
            This is a<br />
            WordPress theme
        <?php } else {
            echo $balloons_option['balloons_site-title_line1']; ?><br />
            <?php echo $balloons_option['balloons_site-title_line2'];       
        } ?>
    </h1>

我最初尝试将 href 放在 h1 之外,但仍然没有成功。

是否有一些隐藏的 WordPress 设置会禁用可点击的标题?或者是否有一些我应该注意的 javascript 会禁用它?

我还应该注意标题的 css 包含 z-index。我在某处读到它可能会受到影响:

#header .content {
line-height: 18px;
margin: 0;
z-index: 4;
}

如果 z-index 影响了它,为什么会这样?

html wordpress wordpress-theming z-index href
1个回答
14
投票

将layout.css的

line 37
上的z-index属性更改为

#header h1 {
position: relative;
z-index: 10; /* Was 2 */
}

您的

.entry
(
z-index:4
) div 从上到下垂直覆盖您的
#header
,其
z-index
高于您的 h1 z-index
(2)
。所以你的 h1/Anchor 无法点击,因为它位于另一个 div 的“下方”。

© www.soinside.com 2019 - 2024. All rights reserved.