可以了解一下的CSS小技巧

<style>
a {text-docoration:none}
a:hover {color: #3366CC;text-decoration:underline}
</style>
2.設(shè)置浮動背景
<style type="text/css">
    body { background-image:url(image/bg.gif); background-attachment:fixed}
</style>
3.正確對齊文本
<style>
    .dq { margin-left: 68px; margin-right: 70px; margin-top:69px; margin-bottom: 71px}
</style>
4.超鏈接訪問過后放置hover樣式出現(xiàn)問題
超鏈接訪問過后防止hover樣式出現(xiàn)問題,可以在head中相應(yīng)的位置輸入

<style type="text/css">
    a:link {
        color:red
    }
    a:hover {
        color:blue
    }
    a:visited {
        color:green
    }
    a:active{
        color:orange
    }
</style>
5.解決list-style-image無法準(zhǔn)確定位的問題
可以在head中相應(yīng)的位置輸入

<style type="text/css">
    li {
        list-style:url ("http://gluu5.163.com//E/11/ 6.gif");
    }
    li a {
        position:relative;
        top:-5px;
        font:12px/25px宋體;
    }
</style>
解決的方法一般是用li的背景模擬,這里采用相對定位的方法也能夠解決。

6.文本垂直居中
<style type="text/css">
    Div {
        height:50px;
        line-height:50px;
    }
</style>
7.border-width
例子 1
border-width:thin medium thick 10px;
上邊框是細(xì)邊框
右邊框是中等邊框
下邊框是粗邊框
左邊框是 10px 寬的邊框
例子 2
border-width:thin medium thick;
上邊框是 10px
右邊框和左邊框是中等邊框
下邊框是粗邊框
例子 3
border-width:thin medium;
上邊框和下邊框是細(xì)邊框
右邊框和左邊框是中等邊框
例子 4
border-width:thin;
所有 4 個邊框都是細(xì)邊框
8.利用CSS去掉下劃線
<style>
    a { text-decoration: none}
</style>
9.設(shè)置滾動條顏色
<style type="text/css">
    html {
        scrollbar-face-color:#f6f6f6;
        scrollbar-highlight-color:#fff000;
        scrollbar-shadow-color:#ee00ee;
        scrollbar-3dlight-color:#ee222e;
        scrollbar-arrow-color:#ccc000;
        scrollbar-track-color:#ddeecc;
        scrollbar-darkshadow-color:#fffddd;
    }
</style>
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容