HTML連載15-文本屬性&顏色控制屬性

1、文本裝飾的屬性git

1.格式:text-decoration:underline;github

2.取值:web

(1)underline表明下劃線微信

(2)line-through表明刪除線webstorm

(3)overline表明上劃線學習

(4)none表明什麼格式都沒有(默認是這個屬性)大數據

注意:none的大多數用處在咱們使用a標籤的時候,能夠用來去掉超級鏈接的下劃線,可見下方演示ui

 

<head>

    <meta charset="UTF-8">

    <title>Title</title>

    <style>

        p{

            text-decoration: line-through;

        }

        u{

            text-decoration: overline;

        }

        h1{

            text-decoration:underline;

        }

        a{

            text-decoration: none;

        }

</style>

</head>

<body>

<u>我是一個事例文字</u>

<p>我也是一個裝飾文字</p>

<h1>我更是一個事例文字</h1>

<a href="https://www.baidu.com">我是一個超級連接</a>

 

3.快捷鍵spa

td表明text-decoration:none;.net

tdu表明text-decoration:undeiline;

tdl表明text-decoration:line-through;

tdo表明text-decoration:overline;

2、文本對齊的屬性

1.格式:text-align:center;

2.取值:

(1)center表明居中

(2)right表明居右

(3)left表明居左

3.快捷鍵

ta代筆text-align:left;

tar表明text-align:right;

tac表明text-align:center;

總結:特殊的記住默認的值,日常的在記住屬性值單詞首字母。

3、文本縮進的屬性

1.格式:text-indent:2em;

2.取值:

(1)3em代筆3個字符

(2)5px表明5個像素

3.快捷鍵:

ti表明text-indent:;

ti2e表明text-indent:2em;

 

<head>

    <meta charset="UTF-8">

    <title>d64_attribute_of_text</title>

    <style>

        p{

            text-decoration: line-through;

            text-align: center;

            text-indent: 2em;

        }

        u{

            text-decoration: overline;

            text-align: right;

            text-indent: 100px;

        }

        h1{

            text-decoration:underline;

            text-align: left;

        }

        a{

            text-decoration: none;

        }

</style>

</head>

<body>

<u>我是一個事例文字</u>

<p>我也是一個裝飾文字</p>

<h1>我更是一個事例文字</h1>

<a href="https://www.baidu.com">我是一個超級連接</a>

</body>

 

4、顏色控制屬性

1.格式:color:值;

2.取值:

(1)顏色英文單詞

注:通常狀況下常見的顏色都是由對應的英文單詞,可是英文單詞可以表達的顏色是有限的,也就說不是全部的顏色都可以經過英文單詞來表達

(2)RGB顏色選擇器

注:紅綠藍三原色,格式:rgb(255,0,0)表明紅色,裏面的數字分別表明紅綠藍三原色各自的亮度,webstorm很智能,能夠寫代碼時直接在旁邊顯示顏色。

 


(3)RGBA顏色選擇器

注:CSS3才推出來的一種格式,其中最後的字母a其實就是表明透明度,最大爲1,最小爲0,值越小越透明

 


(4)十六進制(後天再寫)

(5)十六進制的縮寫

5、源碼:

d64_attribute_of_text

d65_attribute_of_color

地址:

https://github.com/ruigege66/HTML_learning

2.CSDN:https://blog.csdn.net/weixin_44630050(心悅君兮君不知-睿)

3.博客園:https://www.cnblogs.com/ruigege0000/

4.歡迎關注微信公衆號:傅里葉變換,後臺回覆「禮包」獲取Java大數據學習視頻禮包

相關文章
相關標籤/搜索