# 常见css样式
# 公共样式
/* =====================
Reset
===================== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
scroll-behavior: smooth;
}
body {
overflow-x: hidden;
font-family: "Microsoft YaHei", Arial, sans-serif;
color: var(--color-text);
background: var(--color-bg);
}
a {
text-decoration: none;
color: inherit;
transition: all .3s ease;
}
img {
border: none;
background: none;
vertical-align: middle;
max-width: 100%;
}
input,
select,
textarea,
button {
font-family: inherit;
outline: none;
}
li,
ol,
ul {
list-style: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
table,
td,
th {
vertical-align: middle;
}
/* =====================
Theme Variables
===================== */
:root {
/* 默认色 */
--demo-color: #c80010;
/* 主色 */
--color-primary: #c80010;
--color-secondary: #333333;
/* 背景 */
--color-bg: #ffffff;
--color-bg-light: #f5f5f5;
/* 文字 */
--color-text: #333333;
--color-text-light: #666666;
--color-text-gray: #999999;
/* 边框 */
--color-border: #e5e5e5;
/* 状态色 */
--color-success: #52c41a;
--color-warning: #faad14;
--color-error: #ff4d4f;
--color-info: #1890ff;
}
/* =====================
REM Responsive
===================== */
html {
font-size: 5.2083vw;
}
@media screen and (min-width: 1920px) {
html {
font-size: 100px;
}
}
@media screen and (max-width: 1440px) {
html {
font-size: 80px;
}
}
@media screen and (max-width: 1024px) {
html {
font-size: 70px;
}
}
@media screen and (max-width: 768px) {
html {
font-size: 60px;
}
}
@media screen and (max-width: 480px) {
html {
font-size: 50px;
}
}
/* =====================
Layout Container
===================== */
.max1200,
.max1300,
.max1400,
.max1500,
.max1520,
.max1600 {
width: 90%;
margin: 0 auto;
position: relative;
}
.max1200 {
max-width: 1200px;
}
.max1300 {
max-width: 1300px;
}
.max1400 {
max-width: 1400px;
}
.max1500 {
max-width: 1500px;
}
.max1520 {
max-width: 1520px;
}
.max1600 {
max-width: 1600px;
}
@media screen and (max-width: 1280px) {
.max1200,
.max1300,
.max1400,
.max1500,
.max1520,
.max1600 {
width: 92%;
}
}
/* =====================
Common Utilities
===================== */
.clearfix::after {
content: "";
display: block;
height: 0;
clear: both;
overflow: hidden;
visibility: hidden;
}
.clearfix {
zoom: 1;
}
.clearboth {
height: 0;
line-height: 0;
overflow: hidden;
clear: both;
font-size: 0;
}
.fl {
float: left;
}
.fr {
float: right;
}
.fwn {
font-weight: 400;
}
.overflow {
overflow: hidden;
}
.w-full {
width: 100%;
}
.w-1-2 {
width: 50%;
}
.w-1-3 {
width: 33.3333%;
}
.w-1-4 {
width: 25%;
}
@media screen and (max-width: 768px) {
.w-1-2,
.w-1-3,
.w-1-4 {
width: 100%;
}
}
/* =====================
Flex Utilities
===================== */
.flex {
display: flex;
}
.wrap {
flex-wrap: wrap;
}
.j-space-between {
justify-content: space-between;
}
.j-flex-start {
justify-content: flex-start;
}
.j-flex-end {
justify-content: flex-end;
}
.j-center {
justify-content: center;
}
.a-center {
align-items: center;
}
.a-flex-start {
align-items: flex-start;
}
.a-flex-end {
align-items: flex-end;
}
.a-j-center {
align-items: center;
justify-content: center;
}
/* =====================
Text Clamp
===================== */
.clamp1 {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.clamp2,
.clamp3,
.clamp4 {
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
}
.clamp2 {
-webkit-line-clamp: 2;
}
.clamp3 {
-webkit-line-clamp: 3;
}
.clamp4 {
-webkit-line-clamp: 4;
}
/* =====================
Image Hover
===================== */
.com-img,
.com-img2 {
display: block;
overflow: hidden;
}
.com-img img,
.com-img2 img {
display: block;
width: 100%;
}
.com-img img {
transition: transform .5s;
}
.com-img:hover img {
transform: scale(1.2);
}
.com-img2 img {
transition: transform .3s ease-out;
}
.com-img2:hover img {
transform: scale(1.1);
}
/* =====================
Logo State
===================== */
.white-logo {
opacity: 1;
visibility: visible;
}
.black-logo {
display: none;
opacity: 0;
visibility: hidden;
}
# css 毛玻璃效果
-webkit-backdrop-filter: saturate(180%) blur(20px);
backdrop-filter: saturate(180%) blur(20px);
# 文字渐变色
<h2 class="find-title medium-font">探索更广阔的世界,为您</h2>
<style>
-webkit-text-fill-color: transparent;
background: -webkit-linear-gradient(-70deg, #ff7170, #ffe57f);
-webkit-background-clip: text;
</style>
<style>
-webkit-text-fill-color: transparent;
background: -webkit-linear-gradient(-70deg, #9867f0, #ed4e50);
-webkit-background-clip: text;
</style>
<style>
background: linear-gradient(90deg, #f3f9a7, #fbd786, #c6ffdd);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
-webkit-font-smoothing: antialiased;
</style>
<style>
-webkit-text-fill-color: transparent;
background: linear-gradient(90deg, #f59e0b, #ff4582, #0ea5e9);
background-clip: text;
-webkit-background-clip: text;
</style>
# svg