天天學一點(2)——cursor、zoom屬性

1. cursor 屬性規定要顯示的光標的類型(形狀)。html

例:瀏覽器

<html>ssh

<body>
<p>請把鼠標移動到單詞上,能夠看到鼠標指針發生變化:</p>
<span style="cursor:auto">
Auto</span><br />\\默認。瀏覽器設置的光標。
<span style="cursor:crosshair">
Crosshair</span><br />\\光標呈現爲十字線。
<span style="cursor:default">
Default</span><br />\\默認光標(一般是一個箭頭)
<span style="cursor:pointer">
Pointer</span><br />\\光標呈現爲指示連接的指針(一隻手)
<span style="cursor:move">
Move</span><br />\\此光標指示某對象可被移動
<span style="cursor:e-resize">
e-resize</span><br />\\此光標指示矩形框的邊緣可被向右(東)移動。
<span style="cursor:ne-resize">
ne-resize</span><br />\\此光標指示矩形框的邊緣可被向上及向右移動(北/東)。
<span style="cursor:nw-resize">
nw-resize</span><br />\\此光標指示矩形框的邊緣可被向上及向左移動(北/西)。
<span style="cursor:n-resize">
n-resize</span><br />\\此光標指示矩形框的邊緣可被向上(北)移動。
<span style="cursor:se-resize">
se-resize</span><br />\\此光標指示矩形框的邊緣可被向下及向右移動(南/東)。
<span style="cursor:sw-resize">
sw-resize</span><br />\\此光標指示矩形框的邊緣可被向下及向左移動(南/西)。
<span style="cursor:s-resize">
s-resize</span><br />\\此光標指示矩形框的邊緣可被向下移動(北/西)。
<span style="cursor:w-resize">
w-resize</span><br />\\此光標指示矩形框的邊緣可被向左移動(西)。
<span style="cursor:text">
text</span><br />\\此光標指示文本。
<span style="cursor:wait">
wait</span><br />\\此光標指示程序正忙(一般是一隻表或沙漏)。
<span style="cursor:help">
help</span>\\此光標指示可用的幫助(一般是一個問號或一個氣球)。
</body>url

</html>spa

2. zoom屬性指針

zoom:1的做用orm

兼容IE六、IE七、IE8瀏覽器,常常會遇到一些問題,能夠使用zoom:1來解決,有以下做用:
觸發IE瀏覽器的haslayout
解決ie下的浮動,margin重疊等一些問題。
好比,本站使用DIV作一行兩列顯示,HTML代碼:
<div class="h_mainbox">
<h2>推薦文章</h2>
<ul class="mainlist">
<li><a href="#" style="color:#0000FF" target="_blank">CSS庫吧</a></li>
<li><a href="#" style="color:#0000FF" target="_blank">原創< /a></li>
</ul>
</div>
CSS代碼:
.h_mainbox { border:1px solid #dadada; padding:4px 15px; background:url(../mainbox_bg.gif) 0 1px repeat-x; margin-bottom:6px; overflow:hidden}
.h_mainbox h2 { font-size:12px; height:30px; line-height:30px; border-bottom:1px solid #ccc; color:#555;}
.h_mainbox h2 span { float:right; font-weight:normal;}
.h_mainbox ul { padding:6px 0px; background:#fff;}
.mainlist { overflow:auto; zoom:1;}
.h_mainbox li { width:268px; float:left; height:24px; overflow:hidden; background:url(../icon3.gif) 0 6px no-repeat; padding:0px 5px 0px 18px; line-height:200%;}
加紅色的那裏就能夠在IE六、IE七、IE8正常顯示效果了。
相關文章
相關標籤/搜索