CSS0021: css 根据字体的大小 ,自动适应div等其他元素的大小

1,

        /*手机*/
        @media screen and (max-600px) {

            /* 设置字体大小 ,其余元素按字体自动调整大小*/
            body {
                font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
                font-size: 15px;
                color: #000;
            }

            ul {
                list-style: none;
            }

            .nice-select input {
                position: absolute;
                outline: none;
                cursor: pointer;
                width: 13em;
                height: 1.8em;
                font-size: 1em;
                /* 设置内边距 */
                box-sizing: border-box;
                padding: 0 0 0 0.6em;
                border: 2px solid red;
                background: url('../img/icon.png') no-repeat scroll right center transparent;
                background-size: 6% 80%;
                background-position: 96% 50%;
                -webkit-border-radius: .3em;
                -moz-border-radius: .3em;
                border-radius: .3em;
            }

            .nice-select {
                position: absolute;
                z-index: 2;
                width: 13em;
                top: 1em;
                left: 50%;
                transform: translate(-50%, 0);
            }

            .nice-select ul {
                position: absolute;
                z-index: 10001;
                display: none;
                width: 13em;
                top: 1.8em;
                max-height: 360px;
                overflow: hidden;
                overflow-y: auto;
                box-sizing: border-box;
                border: 1px solid #d5d5d5;
                background-color: rgba(240, 237, 241, 0.9);
            }

            .nice-select ul li {
                overflow: hidden;
                padding: 0.2em 0 0.2em 0.6em;
                cursor: pointer;
                border-top: 1px solid #d5d5d5;
            }

            .nice-select ul li.on {
                /* 选中后的颜色 */
                background-color: #e0e0e0;
            }


        }

琥珀君的博客
原文地址:https://www.cnblogs.com/eliteboy/p/14252406.html