猜你喜歡
更多>在css中,可以通過(guò)cursor屬性設(shè)置鼠標(biāo)樣式,語(yǔ)法格式為“cursor: value。cursor屬性用于指定要顯示的光標(biāo)的類型(形狀),并且可以設(shè)置當(dāng)鼠標(biāo)指針?lè)胖迷谠氐倪吔绶秶鷥?nèi)時(shí)所使用的光標(biāo)形狀。
本文的運(yùn)行環(huán)境:Windows7系統(tǒng),HTML5CSS3版本3,DELL G3電腦
有時(shí)我們不想添加文字、圖片和鏈接,但我們想在鏈接時(shí)添加鼠標(biāo)樣式。這使用css中的光標(biāo)來(lái)設(shè)置鼠標(biāo)指針的形狀。
【資料圖】
cursor屬性指定要顯示的光標(biāo)的類型(形狀)。此屬性定義當(dāng)鼠標(biāo)指針?lè)旁谠剡吔鐑?nèi)時(shí)使用的光標(biāo)形狀。
以下是鼠標(biāo)指針的光標(biāo)屬性的一些屬性值:
示例:
!聲明文檔類型
超文本標(biāo)記語(yǔ)言
頭
meta charset="utf-8 "
標(biāo)題/頭銜
/head
身體
請(qǐng)將鼠標(biāo)移到單詞:/p上
span style=" cursor : auto " auto/span br
span style=" cursor :十字線"十字線/spanbr
span style="cursor:default "默認(rèn)值/spanbr
span style=" cursor : e-resize " e-resize/span br
span style="cursor:help "幫助/spanbr
span style="cursor:move "移動(dòng)/spanbr
span style=" cursor :n-resize " n-resize/span br
span style=" cursor : ne-resize " ne-resize/span br
span style=" cursor : NW-resize " NW-resize/span br
span style="cursor:pointer "指針/spanbr
span style="cursor:progress "進(jìn)度/spanbr
span style=" cursor :s-resize " s-resize/span br
span style=" cursor : se-resize " se-resize/span br
span style=" cursor : SW-resize " SW-resize/span br
span style=" cursor : text " text/span br
span style=" cursor : w-resize " w-resize/span br
span style="cursor:wait "等待/spanbr
/body
/html那么鼠標(biāo)就成了我們需要的。
描述:
還有一種用法,其原理是:使用CSS2的一個(gè)cursor屬性,cursor:url (url),鼠標(biāo)文件可以使用jpg、gif、ani和cur文件格式。注意這個(gè)方法只能在IE5.5以上的瀏覽器中正常顯示。
推薦:《css視頻教程》以上是css如何改變鼠標(biāo)樣式的細(xì)節(jié)。請(qǐng)多關(guān)注php中文網(wǎng)站的其他相關(guān)文章!
來(lái)源:php中文網(wǎng)站
標(biāo)簽: