当前位置: 首页 > news >正文

【CSS】CSS 样式重置 (normalize.css 和 reset.css) 和通用样式配置

一般来说,每一个项目初始化阶段都需要样式重置和样式定制化。样式重置最常用的就是 normalize.css 和 reset.css 这两个文件。

他们的区别:

  • Normalize.css更加注重保留有用的浏览器默认样式,仅修复浏览器之间的不一致性,适用于需要一致性、可访问性和可用性的项目。
  • Reset CSS则取消了所有浏览器的默认样式,并使用开发者自己定义的样式来构建网页,适用于需要更多自定义的项目。

上述来源:normalizecss_and_reset_css

所以我再项目中一般会安装 normalize.css

npm i normalize.css

之后全局引入:

import "normalize.css";

然后手动创建 reset.css :

body, html, h1, h2, h3, h4, h5, h6, ul, ol, li, dl, dt, dd, header, menu, section, p, input, td, th, ins {padding: 0;margin: 0;
}a {text-decoration: none;color: #333;
}img {vertical-align: top;
}ul, li {list-style: none;
}button {outline: none;border: none;
}

在这里插入图片描述

还有一个文件:common.css 是配置全局通用 css 文件,比如:

body,
textarea,
select,
input,
button {font-size: 12px;color: #333;font-family: Arial, Helvetica, sans-serif;background-color: #f5f5f5;
}.wrap-v1 {width: 1100px;margin: 0 auto;
}.wrap-v2 {width: 980px;margin: 0 auto;
}.sprite_01 {background: url(../img/sprite_01.png) no-repeat 0 9999px;
}.sprite_02 {background: url(../img/sprite_02.png) no-repeat 0 9999px;
}.sprite_cover {background: url(../img/sprite_cover.png) no-repeat 0 9999px;
}.sprite_icon {background: url(../img/sprite_icon.png) no-repeat 0 9999px;
}.sprite_icon2 {background: url(../img/sprite_icon2.png) no-repeat 0 9999px;
}.sprite_icon3 {background: url(../img/sprite_icon3.png) no-repeat 0 9999px;
}.sprite_button {background: url(../img/sprite_button.png) no-repeat 0 9999px;
}.sprite_button2 {background: url(../img/sprite_button2.png) no-repeat 0 9999px;
}.sprite_table {background: url(../img/sprite_table.png) no-repeat 0 9999px;
}.sprite_playbar {background: url(../img/playbar_sprite.png) no-repeat 0 9999px;
}.sprite_playlist {background: url(../img/playlist_sprite.png) no-repeat 0 9999px;
}
.ant-message {left: 0 !important;transform: none !important;
}
.ant-message-notice-content {position: fixed !important;left: 50% !important;bottom: 60px;transform: translateX(-50%);background-color: rgba(0, 0, 0, 0.7) !important;color: #fff;
}
http://www.lryc.cn/news/474026.html

相关文章:

  • 自动化机器学习(AutoML)详解
  • Linux: network:erspan0
  • 第11课 计算思维
  • ACL, ACL Workshop, ACL Findings 解释
  • 《使用Gin框架构建分布式应用》阅读笔记:p272-p306
  • 【搜索引擎】俄罗斯搜索引擎yandex
  • 加密源代码|html代码如何加密保护?3分钟学会4种源代码加密妙招,代码人必看
  • Jetson Orin NX平台自研载板 IMX477相机掉线问题调试记录
  • spring-boot(整合mybatisplus、及常见注解)
  • 深度学习:yolov3的使用--建立模型
  • 关于我、重生到500年前凭借C语言改变世界科技vlog.13——深入理解指针(3)
  • 每日算法一练:剑指offer——数组篇(6)
  • 【环境搭建】Apache ZooKeeper 3.8.4 Stable
  • 算法练习——双指针
  • vue中el-table显示文本过长提示
  • JS 字符串拼接并去重
  • opencv 图像预处理
  • SAP B1 功能模块字段介绍 - 价格清单(下)
  • 传智杯 第六届-复赛-D
  • Java - 数组实现大顶堆
  • ifuse挂载后,在python代码中访问iOS沙盒目录获取app日志
  • Windows WSL环境下安装 pytorch +ROCM 支持AMD显卡
  • uniapp中skymap.html(8100端口)提示未登录的排查与解决方法
  • 训练模型时梯度出现NAN或者INF(禁用amp的不同level)
  • Maven核心概念
  • Sonatype Nexus 部署手册
  • TLV320AIC3104IRHBR 数据手册 一款低功耗立体声音频编解码器 立体声耳机放大器芯片麦克风
  • (8)结构体、共用体和枚举类型数据
  • Jedis操作和springboot整合redis
  • 基于AI大模型的复杂扫描件PDF信息提取与规整