2013-04-16 53 views
1

我有4个链接添加访客,添加机器,添加主机,添加操作员,我感到惊讶地看到,通过链接悬停光标图标不会改变。 这里是我的代码光标不会改变悬停

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

任何一个可以说我我在做什么你wrong.Thank

+3

这是无效的HTML ..你没有关闭标签标签! – Prasanth

+0

如何提供[小提琴](http://jsfiddle.net)以便我们可以测试您的代码? –

+0

在文字装饰风格之后,在风格中加入'cursor:pointer'。 –

回答

0

请从锚标记中删除标签或如果u要添加标签,你可以锚前加入标签,所以我将完善工作

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

完美工作得很好。谢谢 – dscxz

0

使用CSS而不是在风格=“”,而在块或.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</a></div>

相关问题