-
Notifications
You must be signed in to change notification settings - Fork 3
/
css.txt
70 lines (60 loc) · 1.95 KB
/
css.txt
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Add font
@font-face {
font-family: 'YourFontName'; /*a name to be used later*/
src: url('http://domain.com/fonts/font.ttf'); /*URL to font*/
}
# Substitute font
@font-face {
font-family: "Cantarell";
src: local("sans-serif");
}
# Add multiple font variants
# https://stackoverflow.com/questions/2436749/how-to-add-multiple-font-files-for-the-same-font
@font-face {
font-family: "DejaVu Sans";
src: url("fonts/DejaVuSans.ttf");
}
@font-face {
font-family: "DejaVu Sans";
src: url("fonts/DejaVuSans-Bold.ttf");
font-weight: bold;
}
@font-face {
font-family: "DejaVu Sans";
src: url("fonts/DejaVuSans-Oblique.ttf");
font-style: italic, oblique;
}
@font-face {
font-family: "DejaVu Sans";
src: url("fonts/DejaVuSans-BoldOblique.ttf");
font-weight: bold;
font-style: italic, oblique;
}
Child selector
------------------------------------------------------------
p:last-child {
background: #ff0000;
}
# Second child
p:nth-child(2) {
background: red;
}
Prevent selection
------------------------------------------------------------
https://stackoverflow.com/questions/880512/prevent-text-selection-after-double-click
span.no_selection {
-webkit-user-select: none; /* webkit (safari, chrome) browsers */
-moz-user-select: none; /* mozilla browsers */
-khtml-user-select: none; /* webkit (konqueror) browsers */
-ms-user-select: none; /* IE10+ */
}
Full background on mobile
------------------------------------------------------------
https://stackoverflow.com/questions/13659204/background-size-cover-does-not-cover-mobile-screen
In addition to background-size: cover, also add min-height: 100%
Replace \n with <br> for HTML
============================================================
https://stackoverflow.com/questions/784539/how-do-i-replace-all-line-breaks-in-a-string-with-br-tags
.white-space-pre {
white-space: pre-wrap;
}