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


1,

 

        /*手机*/
        @media screen and (max-width: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;
            }


        }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM