-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
200 lines (185 loc) · 5.03 KB
/
Copy pathstyle.css
File metadata and controls
200 lines (185 loc) · 5.03 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/**Una regla css consta de dos partes:
1) el selector
2) el bloque de declaraciones
atributo:valor*/
/* el @import url() es mala práctica porque es bloqueante a la hora que el navegador lee los documentos*/
@import url('otro-style.css');
html {
/* scroll-behavior: smooth;;
*/
scroll-behavior: smooth;
font-size: 45px;
}
*,*::before,*::after{font-size: inherit;}
body {
background-color:white;
margin-left: 10px;
}
a {
margin: 3px;
}
h2:target{color: #f00;}
.css-curso {color:#00f;}
/* El estilo (style) en línea es el que predomina; le sigue el estilo interno, y el final es el externo */
h1{color: red;
border: 3px;
border-color: red;
border-style: solid;
}
#box{color: #f50;
border: 3px;
border-style: solid;
border-color: blue;
width: 200px;
height: 200px;
}
h2{color: #0f0;}
#texto{color: #00f;
background-color: #0f0;
}
/* un ejemplo con el texto 32.*/
.texto32{
font-size: 32px;
color: yellow;
}
#etiquetas-basicas{
color: #0f5;
}
.bg-blue{background-color: blue;}
.otro{font-style: oblique;}
.hijos-directos>li{background-color: #0f0;}
.hijos-descendientes b{
background-color: #f00 ;
}
.hermanos-generales~li{
background-color: #f00;
}
.hermanos-adyacentes+li{
background-color: #f0f;
}
/* el comodín (*) aplicará el estilo si contiene el texto en cuestión en cualquier parte.*/
.selectores-atributos a[href*="jonmircha"]{
color: orangered;
text-decoration: none;
}
/* el comodín (^) aplicará el estilo si contiene el texto en cuestión al principio */
.selectores-atributos a[href^="https"]{
color: steelblue;
}
/* el símbolo ($) aplicará el estilo si contiene el texto en cuestión al final */
.selectores-atributos a[href$="monios"]{
background-color: #0f5;
}
/* el símbolo (~) aplicará el estilo si contiene el texto en cuestión en una lista separada por espacios*/
.selectores-atributos a[href~="cursos"]{
background-color: #f00;
}
/* el símbolo (|) aplicará el estilo si contiene el texto en cuestión en una lista separada por espacios y que después del texto en cuestión venga un guión medio*/
.selectores-atributos a[class|="horas"]{
font-style: italic;
}
.selectores-atributos a[class|="nueva"]{
font-style: italic;
}
.selector-universal{font-family: sans-serif;
font-style: italic;
}
/* pseudoclases */
article id:target{color: #f00; }
.pseudoclases *:required{ border-color: #f00;}
.pseudoclases *:valid{ border-color: blue;}
.pseudoclases *::selection{font-size: 50px;}
.pseudoclases *:invalid{border-color: #f0f;}
/* las siguientes pseudoclases link active visited hover necesariamente van en ese orden*/
a[href^="#inicio"]:link{
/* font-style: italic; */
color: #0f0;}
a[href^="#inicio"]:active{
/* font-style: italic; */
color: #00f;}
a[href^="#inicio"]:visited{
/* font-style: italic; */
color: #0ff;}
a[href^="#inicio"]:hover{
/* font-style: italic; */
color: #f00;}
.pseudoclases *:focus{
background-color: steelblue;
}
a[href^="#inicio"]{
/* font-style: italic; */
text-decoration: none;}
/* afecta al primer elemento de la lista li*/
.list-pseudoclases li:first-child{color: green;
}
/* afecta al último elemento de la lista li*/
.list-pseudoclases li:last-child{color: red;
}
/* afecta al elemento 3 de la lista li*/
.list-pseudoclases li:nth-child(3){color: navy;}
/* afecta al elemento 2n(n es el numero de posición de los li) de la lista li. Ej:
2n n=1 2n=2*1=2
n=2 2n=4
n=3 2n=6 */
.list-pseudoclases li:nth-child(2n){color: pink;}
.list-pseudoclases li:nth-child(2n+1){font-size: 2rem;}
/* afecta al elemento par de la lista li*/
.list-pseudoclases li:nth-child(even){background-color: yellow;}
/* afecta al elemento impar de la lista li*/
.list-pseudoclases li:nth-child(odd){background-color: green;}
/* afecta al elemento primero del tipo p de la lista */
.article p:first-of-type{
color: red;
}
/* afecta al elemento último del tipo p de la lista */
.article p:last-of-type{
color: blue;
}
/* afecta al elemento primero del tipo div de la lista */
.article div:first-of-type{
color: yellow;
}
/* afecta al elemento último del tipo div de la lista */
.article div:last-of-type{
color: red;
}
.article div:nth-of-type(2){
background-color: blue;
}
.article div:nth-of-type(n+1){
font-size: 1.5rem;
}
.article p:nth-of-type(2n+1){
font-style: italic;
}
.article p:nth-of-type(even){
font-size: 2rem;
}
/* pseudoclases de negación .(not)*/
.article :not(p){
font-size: 3rem;
}
.listas-articulo :not(p){color: red;}
.emoji::after{
content: "😄";
}
.emoji::before{
content: "💌";
}
.pseudoelementos p::first-letter{font-size: 2rem;
color: red;
}
.pseudoelementos2 p::first-letter{font-size: 2rem;
color: blue;
}
.pseudoelementos2 p::first-line{font-size: 1.5rem;
color: blue;
}
/* Este pseudoelemento le define los estilos a la selección, en este caso de todo el documento*/
*::selection{
background-color: black;
color: yellow;
}
.placeholder::placeholder{
color: red;
}