css知识点

字体修饰

        div{
            height: 10px; 
            width: 50px;
            background-color:red;
 
            /* 字体大小 */
            font-size: 50px;
 
            /* 字体粗细(粗:700;细:400):400-700 */
            font-weight: 600;
 
            /* 是否倾斜(normal:正常;italic:倾斜) */
            font-style: italic;
 
            /* 文本对齐(center:居中;right:右对齐),默认左对齐 */
            text-align: center;
 
            /* 颜色色值(rgb法,rgba法,十六进制法,r:red,g:green;b:blue;a:透明度) */
            color: #DDAABB;
            /* color: rgb(40,21,46); */
            /* color: rgba(45, 21, 41, 12); */
 
            /* 行高(数+px;数——size的倍数),垂直居中行高等于height值 */
            line-height: 2;
 
            /* 文字族——设置字体,浏览器依照顺序和自身能够使用字体进行字体选择 */
            font-family: 'Courier New', Courier, monospace;
 
            /* font属性——设置公共样式:倾斜,加粗,大小:30px,行高2倍,字体样式 */
            /* font: italic 400 30px/2; */
 
            /* 文本缩进(数+px;数+em) */
            text-indent: 20px;
 
            /* 图片居中(图片在div标签下)同文字居中 */
 
            /* 文本修饰线 none:无;line-through:删除线;underline:下划线;overline:上划线*/
            text-decoration: line-through;
        }
posted @ 2025-02-19 21:44  guozichan  阅读(7)  评论(0)    收藏  举报