2013-04-16 51 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>

相關問題