標籤:新手 滑鼠指標 splay 選中 radio ica city 顯示 box
一、表單部分
1.禁止textarea文本域的縮放
resize:none;
2.去除初始化textarea下拉條
overflow:auto;
3.如何讓表單中的選項按鈕,點擊文字也能選中?
<lable><input type="radio" name="sex" value="女" checked="checked"/>女</lable>
4.如何讓文本垂直對齊文本輸入框
input{vertical-align:middle;}
5.如何做1像素細邊框的table?
#test{border-collapse:collapse;border:1px solid #ddd;}
#test th,#test td{border:1px solid #ddd;}
<table id="test">
<tr><th>姓名</th><td>少年</td></tr>
<tr><th>年齡</th><td>20</td></tr>
</table>
二、其它部分
1.如何讓單行文本在容器內垂直置中?
#test{height:25px;line-height:25px;}
2.如何讓區塊層級元素置中顯示?
#test{width:900px;height:200px;margin:0 auto;}
3.如何清除圖片下方出現幾像素的空白間隙?
方法1:img{display:block;} 方法2: img{vertical-align:top;}
4.常見的連結樣式
a:link - 普通的、未被訪問的連結
a:visited - 使用者已訪問的連結
a:hover - 滑鼠指標位於連結的上方
a:active - 連結被點擊的時刻
當為連結的不同狀態設定樣式時,請按照以下次序規則:a:hover 必須位於 a:link 和 a:visited 之後a:active 必須位於 a:hover 之後
5.將一個容器設為透明
#test{
filter:alpha(opacity=50);
-moz-opacity:0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
}
在這四行CSS語句中,第一行是IE專用的,第二行用於Firefox,第三行用於webkit核心的瀏覽器,第四行用於Opera。
6.CSS3陰影
外陰影:
.shadow {
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
}
內陰影:
.shadow {
-moz-box-shadow:inset 0 0 10px #000000;
-webkit-box-shadow:inset 0 0 10px #000000;
box-shadow:inset 0 0 10px #000000;
}
為了自己看的時候,方便就放在自己這裡吧
原文 為http://www.duanliang920.com/learn/web/jc/226.html 轉
一些對新手有用的css技巧