CSS常用的屬性和值

CSS文本

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>css文本</title>
<style type="text/css">
   
   body{
       /*color:顏色*/
       color:#F00;
       /*字符間距*/
       letter-spacing:10px;
       /*對齊方式*/
       text-align:center;
       /*文本修飾  下劃線-underline,  中劃線(line-through)   上劃線-overline  沒有:none*/
       text-decoration:line-through;
       /*單詞間距*/
       word-spacing:30px;
   }
</style>
</head>

<body>
今天 天氣 不錯!
</body>
</html>

CSS字體

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>css字體</title>
<style type="text/css">
    body{
        /*字體類型 
        注意:這里的字體類型是讀取系統的默認字體庫,盡量使用通用的字體,如果你設置的字體,用戶的系統上沒有,就是使用默認的宋體顯示。
        */
        /*
        font-family:"宋體";
        */
        /*字體大小*/
        /*
        font-size:24px;
        */
        /*字體樣式: 正(normal默認)  斜(italic)*/
        /*
        font-style:italic;
        */
        /*字體粗細  bold 加粗*/
        /*
        font-weight:bold;
        */
        
        /* font: 簡寫屬性 */
        font:italic bold 36px "黑體";
    }
</style>
</head>

<body>
傳智播客
</body>
</html>

CSS背景

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>css背景</title>
<style type="text/css">
    
    body{
        /*背景顏色*/
        /*
        background-color:#0CF;
        */
        /*背景圖片*/
        /*
        background-image:url(../05.%E7%B4%A0%E6%9D%90/mm.jpg);
        */
        /*設置背景圖片是否重復,或如何重復
            not-repeat: 不重復
            repeat-x: x軸重復
            repeat-y: y軸重復
            repeat: x和y軸重復(默認)
        */
        /*
        background-repeat:no-repeat;
        */
        /*設置背景的起始位置*/
        /*
        background-position:top center;
        */
        /*簡寫屬性*/
        background:#3FF url(../05.%E7%B4%A0%E6%9D%90/mm.jpg) no-repeat top center;
        
    }
</style>
</head>

<body>
</body>
</html>
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容