2015-08-28 57 views
0

我想使下面的錨標籤看起來更加大膽懸停,不使用任何外部或嵌入式CSS文件,我可以通過應用內聯樣式讓它們看起來更大膽?如何在不使用css的情況下製作懸停的HTML錨標籤,只更改內聯樣式?

<a href="https://en.wikipedia.org/wiki/Internet_of_Things" target="_blank" ">Internet of things<br></a> 
<a href="https://en.wikipedia.org/wiki/Machine_to_machine" target="_blank">M2M<br></a> 
<a href="https://en.wikipedia.org/wiki/Mesh_networking" target="_blank">Mesh Network<br></a> 
<a href="https://en.wikipedia.org/wiki/Telemetry" target="_blank">Telemetry<br></a> 
<a href="https://en.wikipedia.org/wiki/Wireless_sensor_network" target="_blank">WSN</a> 
+0

請由四個空格縮進代碼來顯示它的格式正確。 –

回答

0

你不能用內聯CSS做。你必須使用正常<style>標籤或單獨的表:

a { 
    font-weight: normal; 
} 

a:hover { 
    font-weight: bold; 
} 

我強烈建議你嘗試用CSS來做到這一點,但如果你必須用JS做到這一點,這裏有一個解決方案:

<a href="https://en.wikipedia.org/wiki/Internet_of_Things" onmouseover="this.style.fontWeight='bold'" onmouseout="this.style.fontWeight='normal'" target="_blank" ">Internet of things<br></a> 

這裏有一個小提琴:

http://jsfiddle.net/72ehppr1/

+0

非常感謝,對於像我這樣的初學者非常有幫助。 – AhmetSkc

+0

當然。同樣,我建議您改用CSS方式(更新後) –

相關問題