CSS中常用的外观样式和应用

2019-07-10  本文已影响0人  追逐_chase
web.jpeg

CSS外观属性

1.color 颜色

2.行高 line-height

3.text-align 水平对齐方式

4. text-indent 首行缩进(单位:em)

5.letter-spacing 字间距

6. word-spacing单词间距,一般用于英文

7.word-break自动换行

8.white-space设置文本强制在一行显示

9.text-overflow文字溢出

10.text-decoration 文本装饰

11.文字阴影 text-shadow :水平位置 垂直位置 模糊距离 阴影颜色参数

<style>
    body{
        background-color: #ccc;
    }

    div{
        font: 700 80px "微软雅黑";
        color: #ccc;
       
    }

/* 多个阴影 同时存在 */
    div:first-child{
        text-shadow: 1px 1px 1px #ccc, -1px -1px 1px #fff;

    }
    div:last-child{
        text-shadow: -1px -1px 1px #ccc, 1px 1px 1px #fff;
    }
    
    </style>


<div>这是一个凸起的文字</div>
<div>这是一个凹下的文字</div>

image.png

12. border-radius 圆角弧度

用户界面(属性)

input{

        /* outline: 1px solid red; */
        outline-color: blue;
    }
    
image.png
 div {
            width: 100px;
            height: 100px;
            border: 1px solid;
            /* 下面4个属性 显示省略号 */
            display: block;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;

        }
image.png
 .box {
            width: 300px;
            height: 300px;
            border: 1px solid;
            /* 下面4个属性 显示省略号 */
            display: block;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            /*  */
            display: table-cell;
            vertical-align: middle;
           
           

        }
        .box1 {
            width: 100px;
            height: 100px;
          
            background-color: purple;
          
image.png
上一篇 下一篇

猜你喜欢

热点阅读