reset.css 初始化CSS


@charset "utf-8";

/*
Reset CSS
作用:清除和重置 基礎css樣式
*/

/* 一、重置*/

html { overflow-y: scroll; }
/* 讓非ie瀏覽器默認也顯示垂直滾動條,防止因滾動條引起的閃爍 */

body,div,p,span,a,img,
dl,dt,dd,ul,ol,li,
h1,h2,h3,h4,h5,h6,
table,thead,tbody,tr,td,th{
    padding: 0;
    margin: 0;
}

body,
button, input, select, textarea { /* for ie */
    /*font: 12px/1 Tahoma, Helvetica, Arial, "宋體", sans-serif;*/
    font: 12px/1 "微軟雅黑", Tahoma, Helvetica, Arial, sans-serif; /* 用 ascii 字符表示,使得在任何編碼下都無問題 */
    background: transparent;
}
button, input, select, textarea {
    font-size: 100%; /* 使得表單元素在 ie 下能繼承字體大小 */
    border: none;
    outline: none;
}

input::-ms-input-placeholder{
    color:#c2c2c2;
}
input::-webkit-input-placeholder {  /* webkit 瀏覽器*/
    color:#c2c2c2;
}
input::-moz-placeholder { /* 火狐瀏覽器 */
    color:#c2c2c2;
}
textarea::-ms-input-placeholder{
    color:#c2c2c2;
}
textarea::-webkit-input-placeholder {  /* webkit 瀏覽器*/
    color:#c2c2c2;
}
textarea::-moz-placeholder { /* 火狐瀏覽器 */
    color:#c2c2c2;
}
/*  設置input placeholder 樣式 */

select{
    appearance:none;
    -moz-appearance:none;
    -webkit-appearance:none;
    cursor: pointer;
}
select::-ms-expand { display: none; }
/*將默認的select選擇框樣式清除*/


h1,h2,h3,h4,h5,h6{ font-weight: normal;}

em,i{font-style:normal;}

ul,ol{list-style:none;}

a{
    text-decoration: none;
    outline: none;
    color: #7f7f7f;
}
a:visited{
    text-decoration: none;
    outline: none;
}
a:hover {
    text-decoration: none;
    outline: none;
}
a:active{
    text-decoration: none;
    outline: none;
}
a:focus{
    text-decoration: none;
    outline: none;
}

img { vertical-align: top;border: none; } /* 讓鏈接里的 img 無邊框  ie會出現*/

label{
    cursor: pointer;
}
/*  label標簽鼠標移入后變為手型  */

table {
    border-collapse: collapse;   /*合並邊框*/
    border-spacing: 0;
}
/* 重置表格元素 */

/**********************************************************/
/* 二、常用的 class*/

.fl{
    float: left;
}
.fr{
    float: right;
}
.clear_fix:after{
    content:"";
    display: block;
    clear: both;
}
/*清除浮動*/

.beyond_eip{
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
/*超出省略*/

.beyond2_eip{
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp:2;
}
.beyond3_eip{
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp:3;
}
.beyond4_eip{
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp:4;
}
/*超出多行省略*/

.ofh{
    overflow: hidden;
}
/*超出隱藏*/

.el_hide {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
/*  隱藏元素  */

.bg_cover{
    background-position: center;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    background-size: cover;
    background-repeat: no-repeat;
}
/*  背景居中鋪滿  */

.img_center{
    display: inline-block;
    margin: 0 auto;
}
/*  圖片水平居中  */

.sele_none{
    user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}
/*禁止文字選中*/

/*************************************************************/
/* 三、其他*/

/*
1.網站logo
先有一個.icon作為擴展名文件
通過<link rel="icon" href="url路徑"> 引入
*/

/*
2.響應式布局
@media all and (max-width:1200){}
小於750尺寸,建議配合rem來
    var html = document.getElementsByTagName("html")[0];
    var w = html.getBoundingClientRect().width;
    html.style.fontSize = deviceWidth / 20 + "px";
    結合less 有 @rem: 37.5rem;
    在設置css的時候  width:(750/@rem);
    在通過 less 終端命令 lessc index.less > index.css
    轉成css文件即可
*/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM