前端技巧总结1——css篇

作者: 流眸Tel | 来源:发表于2019-07-23 14:44 被阅读1次

前端技巧总结

CSS篇


去掉type=number的箭头

  input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{
      -webkit-appearance: none;
  }
  input[type="number"]{
      -moz-appearance: textfield;
  }
  input{
      -webkit-user-select: text !important;
      -webkit-tap-hightlight-color: rgba(0,0,0,0);
  }

绝对居中

/* 1 */
.father{
  position: absolute;
  top: 50%;
  left: 50%;
}
.son{
  transform: translate(-50%, -50%);
}

/* 2 */
.father{
  position: absolute;
  display: flex;
  justify-content;
  align-items: center;
}

css媒体查询

/*自适应尺寸*/
@media screen and (max-width: 360px) {
    html {
        font-size: 10px;
    }
}

@media (min-width: 361px) and (max-width: 420px) {
    html {
        font-size: 11px;
    }
}

@media (min-width: 421px) and (max-width: 480px) {
    html {
        font-size: 12px;
    }
}

@media (min-width: 481px) and (max-width: 540px) {
    html {
        font-size: 13px;
    }
}

@media (min-width: 541px) and (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 641px) and (max-width: 750px) {
    html {
        font-size: 15px;
    }
}

@media screen and (min-width: 751px) {
    html {
        font-size: 20px;
    }
}

iOS去除点击阴影

-webkit-tap-highlight-color: rgba(0,0,0,0)

css滚动条样式

/*1*/
.progress1 ul{height:50px;overflow:auto;}
.progress1 ul::-webkit-scrollbar {/*滚动条整体样式*/
            width: 4px; /*高宽分别对应横竖滚动条的尺寸*/
            height:4px;
}
.progress1 ul::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
    border-radius: 5px;
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background:lightblue;
}
.progress1 ul::-webkit-scrollbar-track {/*滚动条里面轨道*/
   -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
   border-radius: 0;
   background: rgba(0,0,0,0.1);
}

/*2*/
.modalBox .modalBody::-webkit-scrollbar {/*滚动条整体样式*/
    width: 6px; /*高宽分别对应横竖滚动条的尺寸*/
    height:15px;
}
.modalBox .modalBody::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
    background:rgba(89,126,247,0.2);
    border-radius: 2px;
}
.modalBox .modalBody::-webkit-scrollbar-track {/*滚动条里面轨道*/
    border-radius: 0;
    background:#fff;
}

相关文章

  • CSS教程汇总

    CSS揭秘实用技巧总结 不止于 CSS 灵活运用CSS开发技巧 前端基础篇之CSS世界 你未必知道的49个CSS知...

  • 前端技巧总结1——css篇

    前端技巧总结 CSS篇 去掉type=number的箭头 绝对居中 css媒体查询 iOS去除点击阴影 css滚动条样式

  • 2019-08-12 20个让你效率更高的CSS代码技巧

    20个让你效率更高的CSS代码技巧 前端速报1周前 在这里想与你分享一个由各大CSS网站总结推荐的20个有用的规则...

  • CSS总结(上)

    CSS总结(上) 由于最近在准备前端方面的面试,所以对自己平常工作中用到的地方做出一些总结。该篇是CSS部分(上)...

  • 前端开发规范(实验室版)

    前端编码规范—— HTML 篇 前端编码规范—— CSS 篇 前端编码规范—— JavaScript 篇 这几天和...

  • CSS

    前端代码标准最佳实践:CSS篇

  • 如何能提高CSS编写技巧 提高Web前端开发效率

    如何能提高CSS编写技巧?怎么学好Web前端开发?很多人在学习Web前端时,刚开始都会学习HTML和CSS,HTM...

  • 前端入门系列

    前端HTML & CSS 基础入门(1)初识 前端HTML & CSS 基础入门(2)段落及文本 前端HTML &...

  • 寒冬期前端准备总结---浏览器篇

    ⚠️⚠️传送门⚠️⚠️ 寒冬期前端准备总结---JS篇[寒冬期前端准备总结---浏览器篇]寒冬期前端准备总结---...

  • 寒冬期前端准备总结---JS篇

    ⚠️⚠️传送门⚠️⚠️ [寒冬期前端准备总结---JS篇]寒冬期前端准备总结---浏览器篇寒冬期前端准备总结---...

网友评论

    本文标题:前端技巧总结1——css篇

    本文链接:https://www.haomeiwen.com/subject/ixoolctx.html