伪元素

input 默认文字

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: pink;
}
::-moz-placeholder { /* Firefox 19+ */
color: pink;
}
:-ms-input-placeholder { /* IE 10+ */
color: pink;
}
:-moz-placeholder { /* Firefox 18- */
color: pink;
}

::-webkit-input-placeholder,
::-moz-placeholder,
:-ms-input-placeholder,
:-moz-placeholder {
color: pink;
}

鼠标选中样式

1
2
3
4
::selection {
color: white;
background: #f7630c;
}

滚动条样式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#gh_repos::-webkit-scrollbar {
-webkit-appearance: none;
width: 8px;
height: 8px
}
#gh_repos::-webkit-scrollbar-track {
background-color: inherit
}
#gh_repos::-webkit-scrollbar-thumb {
background-color: rgba(182,182,182);
border: 1px solid #fff;
border-radius: 10px
}
#gh_repos::-webkit-scrollbar-thumb:hover {
background-color: rgba(182,182,182,.1)
}
#gh_repos::-webkit-scrollbar-thumb:active {
background-color: rgba(182,182,182,.2)
}
#gh_repos {
overflow-x: hidden;
overflow-y: auto
max-height:25.5em
}

背景图滤镜效果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#main {
position: relative;
z-index: 0;
}

div#main::after {
content: "";
background-size: cover;
background-position: center;
opacity: .06;
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1
}

#main>#content {
z-index: 5;
}

#main>#content>div::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%), linear-gradient(360deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%);
background-size: 20px 20px;
background-position: center center;
}
/* div#main::after{background-image: url(https://api.imacroc.cn/acg/)} */
div#main::after {
background-image: url(https://api.imacroc.cn/bing/)
}

背景颜色动画

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
body::after{
content:"";
background: linear-gradient(90deg, rgba(247, 149, 51, .1), rgba(243, 112, 85, .1) 15%, rgba(239, 78, 123, .1) 30%, rgba(161, 102, 171, .1) 44%, rgba(80, 115, 184, .1) 58%, rgba(16, 152, 173, .1) 72%, rgba(7, 179, 155, .1) 86%, rgba(109, 186, 130, .1))
background-size: 500% 500%;
-webkit-animation: Gradient 6s ease infinite;
-moz-animation: Gradient 6s ease infinite;
animation: Gradient 6s ease infinite;
-o-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left:0;
z-index:-1;
}

媒体查询

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@media only screen and (max-width: 768px) {
/* 分辨率小于等于 768像素 显示的样式 */
}
@media only screen and (min-width: 768px) {
/* 分辨率大于等于 768像素 显示的样式 */
}
@media only screen and (min-width: 768px) {
/* 分辨率大于等于 768像素 显示的样式 */
}
@media print
{
/* 打印使用的样式 */
p.test {font-family:times,serif; font-size:10px}
}

@media screen,print
{
/* 手机电脑平板屏幕和打印使用的样式 */
p.test {font-weight:bold}
}
/*
all 用于所有的媒介设备。
aural 用于语音和音频合成器。
braille 用于盲人用点字法触觉回馈设备。
embossed 用于分页的盲人用点字法打印机。
handheld 用于小的手持的设备。
print 用于打印机。
projection 用于方案展示,比如幻灯片。
screen 用于电脑显示器。
tty 用于使用固定密度字母栅格的媒介,比如电传打字机和终端。
tv 用于电视机类型的设备。
*/

其它

双击不选中文本

1
2
3
4
5
6
html,body{
-moz-user-select:none; /*火狐*/
-webkit-user-select:none; /*webkit浏览器*/
-ms-user-select:none; /*IE10*/
user-select:none;
}

z-index最大值

1
2
3
div{
z-index:2147483647;
}