常用的css文件_css常用的三种选择器

常用的css文件_css常用的三种选择器reset.css(几乎每个项目都要引入的css)@charset"utf-8";html{background-color:#fff;color:#000;font-size

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

reset.css(几乎每个项目都要引入的css)

常用的css文件_css常用的三种选择器
常用的css文件_css常用的三种选择器

@charset "utf-8";html{background-color:#fff;color:#000;font-size:12px}
body,ul,ol,dl,dd,h1,h2,h3,h4,h5,h6,figure,form,fieldset,legend,input,textarea,button,p,blockquote,th,td,pre,xmp{margin:0;padding:0}
body,input,textarea,button,select,pre,xmp,tt,code,kbd,samp{line-height:1.5;font-family:tahoma,arial,"Hiragino Sans GB",simsun,sans-serif}
h1,h2,h3,h4,h5,h6,small,big,input,textarea,button,select{font-size:100%}
h1,h2,h3,h4,h5,h6{font-family:tahoma,arial,"Hiragino Sans GB","微软雅黑",simsun,sans-serif}
h1,h2,h3,h4,h5,h6,b,strong{font-weight:normal}
address,cite,dfn,em,i,optgroup,var{font-style:normal}
table{border-collapse:collapse;border-spacing:0;text-align:left}
caption,th{text-align:inherit}
ul,ol,menu{list-style:none}
fieldset,img{border:0}
img,object,input,textarea,button,select{vertical-align:middle}
article,aside,footer,header,section,nav,figure,figcaption,hgroup,details,menu{display:block}
audio,canvas,video{display:inline-block;*display:inline;*zoom:1}
blockquote:before,blockquote:after,q:before,q:after{content:"\0020"}
textarea{overflow:auto;resize:vertical}
input,textarea,button,select,a{outline:0 none;border: none;}
button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}
mark{background-color:transparent}
a,ins,s,u,del{text-decoration:none}
sup,sub{vertical-align:baseline}
html {overflow-x: hidden;height: 100%;font-size: 50px;-webkit-tap-highlight-color: transparent;}
body {font-family: Arial, "Microsoft Yahei", "Helvetica Neue", Helvetica, sans-serif;color: #333;font-size: .28em;line-height: 1;-webkit-text-size-adjust: none;}
hr {height: .02rem;margin: .1rem 0;border: medium none;border-top: .02rem solid #cacaca;}
a {color: #25a4bb;text-decoration: none;}

View Code

border.css(移动端1像素问题解决)

常用的css文件_css常用的三种选择器
常用的css文件_css常用的三种选择器

@charset "utf-8";
.border,
.border-top,
.border-right,
.border-bottom,
.border-left,
.border-topbottom,
.border-rightleft,
.border-topleft,
.border-rightbottom,
.border-topright,
.border-bottomleft {
    position: relative;
}
.border::before,
.border-top::before,
.border-right::before,
.border-bottom::before,
.border-left::before,
.border-topbottom::before,
.border-topbottom::after,
.border-rightleft::before,
.border-rightleft::after,
.border-topleft::before,
.border-topleft::after,
.border-rightbottom::before,
.border-rightbottom::after,
.border-topright::before,
.border-topright::after,
.border-bottomleft::before,
.border-bottomleft::after {
    content: "\0020";
    overflow: hidden;
    position: absolute;
}
/* border
 * 因,边框是由伪元素区域遮盖在父级
 * 故,子级若有交互,需要对子级设置
 * 定位 及 z轴
 */
.border::before {
    box-sizing: border-box;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    border: 1px solid #eaeaea;
    transform-origin: 0 0;
}
.border-top::before,
.border-bottom::before,
.border-topbottom::before,
.border-topbottom::after,
.border-topleft::before,
.border-rightbottom::after,
.border-topright::before,
.border-bottomleft::before {
    left: 0;
    width: 100%;
    height: 1px;
}
.border-right::before,
.border-left::before,
.border-rightleft::before,
.border-rightleft::after,
.border-topleft::after,
.border-rightbottom::before,
.border-topright::after,
.border-bottomleft::after {
    top: 0;
    width: 1px;
    height: 100%;
}
.border-top::before,
.border-topbottom::before,
.border-topleft::before,
.border-topright::before {
    border-top: 1px solid #eaeaea;
    transform-origin: 0 0;
}
.border-right::before,
.border-rightbottom::before,
.border-rightleft::before,
.border-topright::after {
    border-right: 1px solid #eaeaea;
    transform-origin: 100% 0;
}
.border-bottom::before,
.border-topbottom::after,
.border-rightbottom::after,
.border-bottomleft::before {
    border-bottom: 1px solid #eaeaea;
    transform-origin: 0 100%;
}
.border-left::before,
.border-topleft::after,
.border-rightleft::after,
.border-bottomleft::after {
    border-left: 1px solid #eaeaea;
    transform-origin: 0 0;
}
.border-top::before,
.border-topbottom::before,
.border-topleft::before,
.border-topright::before {
    top: 0;
}
.border-right::before,
.border-rightleft::after,
.border-rightbottom::before,
.border-topright::after {
    right: 0;
}
.border-bottom::before,
.border-topbottom::after,
.border-rightbottom::after,
.border-bottomleft::after {
    bottom: 0;
}
.border-left::before,
.border-rightleft::before,
.border-topleft::after,
.border-bottomleft::before {
    left: 0;
}
@media (max--moz-device-pixel-ratio: 1.49), (-webkit-max-device-pixel-ratio: 1.49), (max-device-pixel-ratio: 1.49), (max-resolution: 143dpi), (max-resolution: 1.49dppx) {
    /* 默认值,无需重置 */
}
@media (min--moz-device-pixel-ratio: 1.5) and (max--moz-device-pixel-ratio: 2.49), (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 2.49), (min-device-pixel-ratio: 1.5) and (max-device-pixel-ratio: 2.49), (min-resolution: 144dpi) and (max-resolution: 239dpi), (min-resolution: 1.5dppx) and (max-resolution: 2.49dppx) {
    .border::before {
        width: 200%;
        height: 200%;
        transform: scale(.5);
    }
    .border-top::before,
    .border-bottom::before,
    .border-topbottom::before,
    .border-topbottom::after,
    .border-topleft::before,
    .border-rightbottom::after,
    .border-topright::before,
    .border-bottomleft::before {
        transform: scaleY(.5);
    }
    .border-right::before,
    .border-left::before,
    .border-rightleft::before,
    .border-rightleft::after,
    .border-topleft::after,
    .border-rightbottom::before,
    .border-topright::after,
    .border-bottomleft::after {
        transform: scaleX(.5);
    }
}
@media (min--moz-device-pixel-ratio: 2.5), (-webkit-min-device-pixel-ratio: 2.5), (min-device-pixel-ratio: 2.5), (min-resolution: 240dpi), (min-resolution: 2.5dppx) {
    .border::before {
        width: 300%;
        height: 300%;
        transform: scale(.33333);
    }
    .border-top::before,
    .border-bottom::before,
    .border-topbottom::before,
    .border-topbottom::after,
    .border-topleft::before,
    .border-rightbottom::after,
    .border-topright::before,
    .border-bottomleft::before {
        transform: scaleY(.33333);
    }
    .border-right::before,
    .border-left::before,
    .border-rightleft::before,
    .border-rightleft::after,
    .border-topleft::after,
    .border-rightbottom::before,
    .border-topright::after,
    .border-bottomleft::after {
        transform: scaleX(.33333);
    }
}

View Code

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/166725.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 罗技键盘k380打不了字_罗技k380键盘配对成功后无法使用

    罗技键盘k380打不了字_罗技k380键盘配对成功后无法使用mac连接成功罗技k380键盘,但是发现数字键上面的字符对不上,很多字符以及标点符号都打不出来,是什么原因导致的呢?问题分析首先,分析一下,到底是什么原因导致的?可以连接其他设备试一试,比如我发现k380键盘在我的ipad上是可以正常使用的。那么就排除了键盘本身存在问题,坏了等猜测。如果不是键盘本身出了问题,那么我们就要去分析问题究竟出现在哪里?联系了客服,加上自己对键盘配对过程的回顾,大致判定问题出现在最开始的匹配的时候,选错了【键盘类型】。解决问题-重设【键盘类型】步骤如下:【系统偏好设置

    2022年10月9日
    0
  • java之接口[通俗易懂]

    java之接口[通俗易懂]java之接口1、接口的概念2、接口的属性3、接口与抽象类4、静态和私有方法5、默认方法6、解决默认方法冲突7、接口与回调1、接口的概念在java中,接口不是类,而是对符合这个接口的类的一组需求接口用interface声明声明一个Comparable接口可以将接口看成一个没有实例字段的抽象类publicinterfaceComparable{ 声明一个方法,方法的实现由实现这个接口的类来实现方法 接口绝不会有示例字段,在java8以前,在接口中绝对不会实现 方法。 priv

    2022年7月7日
    24
  • 提高计算机软件速度的方法,提高电脑速度的10个有效方法

    提高计算机软件速度的方法,提高电脑速度的10个有效方法电脑已经离不开我们的工作、生活。当我们使用电脑的时候是不是经常遇到打开网页速度和运行某款游戏的时候速度很慢,大部分人处理的办法就是责骂自己的网速不行,电脑配置太低问题,或者我们选择重装系统、格式化等方法,但用不了多久还是会变慢。有些时候并不是这些问题导致电脑速度变慢的。学会以下10个基础的电脑加速方法,有助于我们即便用普通配置的电脑,也可以健步如飞。方法1,桌面上尽量干净。有一次我去同学那…

    2022年6月3日
    40
  • 手机丅f丅lcd什么屏_手机丅f丅lcd什么屏_全球首款屏下相机,90Hz OLED屏+4220mAh「建议收藏」

    手机丅f丅lcd什么屏_手机丅f丅lcd什么屏_全球首款屏下相机,90Hz OLED屏+4220mAh「建议收藏」在传统非全面屏手机时,指纹很好实现,放个传感器在屏幕下方区域就行了,但是全面屏时代,很多手机将指纹改为后置或者侧边指纹,不过后置太难看了,侧边指纹体验不是很好,还是屏幕指纹体验最好,OLED非常轻薄,而且具有一定的光通透性,因此可以实现屏幕指纹,指纹是解决了,但是前置摄像头的放置又是一个问题,刘海屏、水滴屏和挖孔屏都不能形成完美的真全面屏。不过功夫不负有心人,任何再难的技术,只要敢想就能实现,敢做…

    2022年8月10日
    10
  • APK签名机制原理详解

    APK签名机制原理详解众所周知,Android系统在安装Apk的过程中,会对Apk进行签名校验,校验通过后才能安装成功。那你知道签名校验的机制是什么?具体校验的是什么内容吗?申请第三方SDK(如微信支付)时填入的SAH1值是什么?目前众多的快速批量打包方案又是如何绕过签名检验的?我将通过一系列的文章来解开这些疑惑。

    2022年6月14日
    31
  • JS经常使用字符串处理方法总结

    JS经常使用字符串处理方法总结

    2022年2月6日
    239

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号