鼠标悬停时不改变

问题描述 投票:0回答:6
php html hyperlink
6个回答
0
投票

请从锚标记内部删除标签,或者如果您想添加标签,您可以在锚标记之前添加它,这样我就能完美工作

喜欢

<div style="margin-left:800px;"><label for="addhost"><a style="text-decoration:none" href="addhost/addhostui.php">ADD HOST</a></label></div>

0
投票

使用 CSS,但不要在 style="" 中使用,而是在块或 .css 文件中使用。

您的代码无效。例如标签没有结束标签

使用悬停功能

<style>
a {text-decoration:none;}
a:hover{color:red;}
div.mystyle{margin-left:800px;margin-top:-200px;}
</style>

正确的 HTML

        <div class="mystyle"><a href="addvisitorui.php"><label for="addvisitor">ADD VISITOR</label></a></div>
        <div class="mystyle"><a href="addmachine/addmachineui.php"><label for="addmachine">ADD MACHINE</label></a></div>
        <div class="mystyle"><a href="addhost/addhostui.php"><label for="addhost">ADD HOST</label></a></div>
        <div class="mystyle"><a href="addoperator/addoperatorui.php"><label for="addoperator">ADD OPERATOR</label></a></div> 

为什么还要使用标签标签?


0
投票

尝试通过关闭标签来修复标签,应该可以解决您的问题。

<div style="margin-left:800px;margin-top:-200px;">
    <a style="text-decoration:none" href="addvisitorui.php">
        <label for="addvisitor">ADD VISITOR</label>
    </a>
</div>

0
投票

您的 HTML 格式错误:

<div style="margin-left:800px;margin-top:-200px;">
    <a style="text-decoration:none" href="addvisitorui.php">
        <label for="addvisitor">ADD VISITOR</label>
    </a>
</div>
<div style="margin-left:800px;">
    <a style="text-decoration:none" href="addmachine/addmachineui.php">
        <label for="addmachine">ADD MACHINE</label>
    </a>
</div>
<div style="margin-left:800px;">
    <a style="text-decoration:none" href="addhost/addhostui.php">
        <label for="addhost">ADD HOST</label>
    </a>
</div>
<div style="margin-left:800px;">
    <a style="text-decoration:none" href="addoperator/addoperatorui.php">
        <label for="addoperator">ADD OPERATOR</label>
    </a>
</div> 

您还需要添加 CSS 规则来指定

label
应使用
pointer
光标:

a label {
    cursor: pointer
}

0
投票

试试这个:

div style="cursor:pointer;margin-left:800px;"

当您将鼠标悬停在 div 上时,光标将更新为指针。


0
投票

您可以尝试在您的 div 中添加以下内容:

cursor:pointer
:

<div style="margin-left:800px; margin-top:-200px; cursor:pointer;">
   <a style="text-decoration:none" href="addvisitorui.php">
      <label for="addvisitor">
          ADD VISITOR
      </label>
   </a>
</div>
© www.soinside.com 2019 - 2024. All rights reserved.