初始化css

初始化标签样式

@charset "utf-8";
/*********************************************/
html{
    /*禁用iPhone中Safari的字号自动调整*/
    -webkit-text-size-adjust:100%;
    -ms-text-size-adjust:100%;
    /* 解决IOS默认滑动很卡的情况 */
    -webkit-overflow-scrolling : touch;
}
body{
    background-color: #fff;
    font-family: PingFangSC-Regular, sans-serif,"Microsoft Yahei";
    position: relative;
    color: #333;
}
/* 禁止选中文本(如无文本选中需求,此为必选项) */
/* html, body {-webkit-user-select: none;user-select: none;} */

p, a, input, select, span, em, i, textarea, form, div, table,label, td, th,li,h1,h2,h3,button{
    font-family: PingFangSC-Regular, sans-serif,"Microsoft Yahei";
}
a, a:hover, a:visited, a:link, a:active{
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: rgba(255,255,255,0);
}
/* 禁止长按链接与图片弹出菜单 */
a, img {
    -webkit-touch-callout: none;
}
ul,ol,li{
    list-style: none;
}
input, textarea,label, button,select,img,form,table,a{
    -webkit-tap-highlight-color: rgba(255,255,255,0);
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
    border: none;
}
/*去除iPhone中默认的input样式*/
input, button, select, textarea{
    outline: none;
    -webkit-appearance: none;
    resize:none;
}
em, i{
    font-style: normal;
}
*{
    margin: 0;
    padding: 0;
}
*:focus{
    outline: none;
}
/*********************************************/
table{
    border-spacing:0px;
    table-layout: fixed;
    border-bottom:0px;
    padding: 0px;
    margin:0px;
    -webkit-text-size-adjust: none;
}
table tr td{
    border-right: 1px solid #666666;
    border-bottom: 1px solid #666666;
}
table tr:first-child td{
    border-top: 1px solid #666666;
}
table tr td:first-child{
    border-left: 1px solid #666666;
}
/* 弹性布局 */
.flexBox{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

自适应基础字体大小设置

/*=========================320*480=========================================*/
@media screen and (min-width: 320px) and (max-width: 360px){
    html, body{font-size: 9px;}
}
@media screen and (min-width: 360px) and (max-width: 450px){
    html, body{font-size: 10px;}
}
@media screen and (min-width: 450px) and (max-width: 760px){
    html, body{font-size: 11px;}
}
@media screen and (min-width: 760px) and (max-width: 1024px){
    html, body{font-size: 12px;}
}
@media screen and (min-width: 1024px)and (max-width: 1366px){
    html, body{font-size: 14px;}
}
/*=========================320*480=========================================*/

清除浮动带来的影响

.clearfix:after{
    content: "";
    display: block;
    visibility: hidden;
    height: 0;
    clear: both;
}
.clearfix{
    zoom:1
}

文字超出显示省略号

/*单行文字超出显示省略号*/
.overHideOne{
    overflow: hidden;
    text-overflow:ellipsis;
    white-space: nowrap;
}
/*两行文字超出显示省略号*/
.overHideTwo{
    overflow: hidden;
    text-overflow:ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    word-break: break-all;
    -webkit-box-orient: vertical;
}

相关推荐

  1. 初始化css

    2024-06-11 05:40:02       7 阅读
  2. 什么是css初始化

    2024-06-11 05:40:02       41 阅读
  3. css】html 标初始化CSS样式(初学者必看)

    2024-06-11 05:40:02       10 阅读
  4. 写一个在创建css文件之后的初始化样式

    2024-06-11 05:40:02       11 阅读
  5. CSP】202203-1_未初始化警告Python实现

    2024-06-11 05:40:02       34 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-11 05:40:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-11 05:40:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-11 05:40:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-11 05:40:02       18 阅读

热门阅读

  1. VM渗透系统合集(下载链接)

    2024-06-11 05:40:02       10 阅读
  2. springboot事件发布机制之生产运用

    2024-06-11 05:40:02       8 阅读
  3. C++ C_style string overview and basic Input funcitons

    2024-06-11 05:40:02       5 阅读
  4. Helm在线部署Longhorn(1.6.0版本)分布式存储

    2024-06-11 05:40:02       7 阅读
  5. 常用API

    常用API

    2024-06-11 05:40:02      12 阅读