【筆記】css英文字母大小寫轉換,首字母樣式,文本陰影

//html

<h1>測試首個字放大</h1>
<h2>文字陰影</h2>
<p>abcd--------------首字母大寫</p>
<p>abcd--------------首字母小寫</p>
<p>abcd--------------全部大寫</p>
<p>abcd--------------全部小寫</p>

//css

        h1:first-letter{     /*選中首字母/首個字*/
            font-size: 200%;
            color: #51e1e2;
        }
        h2{   /*設置文字陰影*/
            text-shadow: 2px 2px 5px #98b9b9;   /*文字陰影(水平,垂直,模糊距離,陰影顏色)*/
        }
        p:nth-of-type(1){     /*首字母大寫(注意:此處並未手動選中首字母)*/
            text-transform: capitalize;  /*首字母大寫*/
        }
        p:nth-of-type(2):first-letter{     /*選中首字母/首個字*/
            text-transform: lowercase;  /*首字母小寫*/
        }
        p:nth-of-type(3){
            text-transform: uppercase;  /*全部大寫*/
        }
        p:nth-of-type(4){
            text-transform: lowercase;  /*全部小寫*/
        }

//實現效果
實現效果

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章