CSS - Diseño responsive

 
Vista:
sin imagen de perfil
Val: 9
Ha aumentado su posición en 6 puestos en CSS (en relación al último mes)
Gráfica de CSS

Diseño responsive

Publicado por valentin (2 intervenciones) el 25/09/2020 01:28:56
Hola.
¿Cómo puedo hacer que este maquetado, el cual representa el tablero de un juego de cartas, funcione en distintas resoluciones de pantalla sin que se colapse todo?
soy muy novato con css y no tengo ni idea la verdad

Saludos

HTML:
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title></title>
  <link rel="stylesheet" href="main.css">
</head>
<body>
  <div class="container">
    <div class="center">
      <div class="mazo">
	<img id="mazo_img" src="./cartas/UN.png">
	<img id="mazo_img" src="./cartas/UN.png">
      </div>
      <div class="pila">
    	<img id="pila_img" src="./cartas/9V.png">
      </div>
    </div>
    <div class="container__content" id="top-left">
      <div class="container__content-cards">
        <img src="./cartas/CN.png" alt="">
        <img src="./cartas/3A.png" alt="">
        <img src="./cartas/3R.png" alt="">
        <img src="./cartas/3A.png" alt="">
        <img src="./cartas/SR.png" alt="">
        <img src="./cartas/MM.png" alt="">
        <img src="./cartas/4V.png" alt="">
        <img src="./cartas/7R.png" alt="">
      </div>
      <div class="container__footer ">
	<button><i class="fas fa-question"></i></button>
	<button><i class="fas fa-plus"></i></button>
	<button><i class="fas fa-user-slash"></i></button>
	<button><i class="fas fa-share"></i></button>
        <p>player1 (100pt)</p>
      </div>
    </div>
    <div class="container__content" id="top_right">
      <div class="container__content-cards">
        <img src="./cartas/0R.png" alt="">
        <img src="./cartas/SM.png" alt="">
        <img src="./cartas/8A.png" alt="">
        <img src="./cartas/MM.png" alt="">
        <img src="./cartas/6R.png" alt="">
        <img src="./cartas/8V.png" alt="">
        <img src="./cartas/6A.png" alt="">
      </div>
      <div class="container__footer">
        <button><i class="fas fa-question"></i></button>
	<button><i class="fas fa-plus"></i></button>
	<button><i class="fas fa-user-slash"></i></button>
	<button><i class="fas fa-share"></i></button>
        <p>player2 (50pt)</p>
      </div>
    </div>
    <div class="container__content" id="button-left">
      <div class="container__content-cards">
        <img src="./cartas/MA.png" alt="">
        <img src="./cartas/2M.png" alt="">
        <img src="./cartas/1R.png" alt="">
        <img src="./cartas/SV.png" alt="">
        <img src="./cartas/SM.png" alt="">
        <img src="./cartas/7V.png" alt="">
        <img src="./cartas/2R.png" alt="">
      </div>
      <div class="container__footer">
        <button><i class="fas fa-question"></i></button>
	<button><i class="fas fa-plus"></i></button>
	<button><i class="fas fa-user-slash"></i></button>
	<button><i class="fas fa-share"></i></button>
        <p>player3 (200pt)</p>
      </div>
    </div>
    <div class="container__content" id="button-right">
      <div class="container__content-cards">
        <img src="./cartas/CN.png" alt="">
        <img src="./cartas/5A.png" alt="">
        <img src="./cartas/NN.png" alt="">
        <img src="./cartas/4V.png" alt="">
        <img src="./cartas/BM.png" alt="">
        <img src="./cartas/8A.png" alt="">
        <img src="./cartas/0V.png" alt="">
      </div>
      <div class="container__footer">
        <button><i class="fas fa-question"></i></button>
	<button><i class="fas fa-plus"></i></button>
	<button><i class="fas fa-user-slash"></i></button>
	<button><i class="fas fa-share"></i></button>
        <p>player4 (153pt)</p>
      </div>
    </div>
      </div>
 </body>
 <script src="https://kit.fontawesome.com/0ec8db641d.js" crossorigin="anonymous"></script>
</html>

CSS:
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
@import url('https://fonts.googleapis.com/css2?family=Sen&display=swap');
 
* {
  margin:0;
  padding: 0;
  font-family: 'Sen', sans-serif;
  box-sizing: border-box;
}
 
body {
    background: linear-gradient( to bottom right,
    #2C3E50, #FD746C,
    #92FE9D, #00C9FF,
    #a044ff, #e73827);
    background-repeat: no-repeat;
    background-size: 1000% 1000%;
    animation: gradient 1000s ease infinite;
}
 
img {
  width: 115px;
  height: 170px;
  position: absolute;
  margin: 20px 5px;
  transition: margin .25s;
}
 
.container {
  display: flex;
  z-index: 50;
  position:relative;
  height: 100vh;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
}
 
 
.center {
  display: flex;
  z-index: 20;
  height: 100vh;
  width: 100%;
  position:fixed;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
.mazo {
  width: 135px;
  height: 190px;
  background-color: rgba(33,33,33,.5);
  margin: 6px;
  border-radius: 8px;
}
 
.pila {
  width: 135px;
  height: 190px;
  background-color: rgba(33,33,33,.5);
  margin: 6px;
  border-radius: 8px;
}
 
#mazo_img {
  margin: 10px;
}
 
#pila_img {
  margin: 10px;
}
 
#top-left {
  display: grid;
  justify-content: flex-start;
  align-content: flex-start;
}
 
#top_right {
  display: grid;
  justify-content: flex-end;
  align-content: flex-start;
}
 
#button-left {
  display: grid;
  justify-content: flex-start;
  align-content: flex-end;
}
 
#button-right {
  display: grid;
  justify-content: flex-end;
  align-content: flex-end;
}
 
.container__content{
  margin: 10px;
  justify-content: flex-start;
}
 
.container__footer {
  display: grid;
  grid-template-columns: 3rem 3rem 3rem 3rem auto;
}
 
.container__footer p {
  margin-left: 20%;
  padding: 10px;
  font-size: 20px;
  justify-content: end;
  text-shadow: 1px 1px 15px #000, 1px 1px 35px #000;
}
 
.container__content-cards {
  border-radius: 8px;
  width: 500px;
  height: 210px;
  padding-left: 0;
  background-color: rgba(33,33,33,.5);
}
 
.container__content-cards img:nth-child(1) {
  margin-left: 1rem;
  z-index: 100;
}
 
.container__content-cards img:nth-child(2) {
  margin-left: 3rem;
  z-index: 200;
}
 
 
.container__content-cards img:nth-child(3) {
  margin-left: 5rem;
  z-index: 300;
}
 
.container__content-cards img:nth-child(4) {
  margin-left: 7rem;
  z-index: 400;
}
 
.container__content-cards img:nth-child(5) {
  margin-left: 9rem;
  z-index: 500;
}
 
.container__content-cards img:nth-child(6) {
  margin-left: 11rem;
  z-index: 600;
}
 
.container__content-cards img:nth-child(7) {
  margin-left: 13rem;
  z-index: 700;
}
 
.container__content-cards img:nth-child(8) {
  margin-left: 15rem;
  z-index: 800;
}
 
.container__content-cards img:nth-child(9) {
  margin-left: 17rem;
  z-index: 900;
}
 
.container__content-cards img:nth-child(10) {
  margin-left: 19rem;
  z-index: 1000;
}
 
.container__content-cards img:nth-child(11) {
  margin-left: 21rem;
  z-index: 1100;
}
 
.container__content-cards img:nth-child(12) {
  margin-left: 23rem;
  z-index: 1200;
}
 
.container__content-cards img:hover {
  margin-top: -3px;
  position: absolute;
  transform: scale(1.06);
  float-left: -1px;
  cursor: pointer;
}
 
#mazo_img {
  transition: all .2s;
}
 
#mazo_img:hover {
  transform: rotate(5deg);
  margin-top: -1px;
}
 
.mazo {
  transition: all .6s;
}
 
.mazo:hover {
  box-shadow: 4px 4px 8px #ed4232,  -4px -4px 8px #ed4232;
}
 
button {
  position: relative;
  z-index: 20;
  width: 35px;
  height: 35px;
  background-color: rgba(33,33,33,.5);
  border:none;
  border-radius: 50%;
  margin-top: 8px;
  margin-left: 5px;
  outline: none;
  transition: all .2s;
}
 
button:hover {
  border: 2px solid #ed4232;
}
 
button:active {
  box-shadow: inset 2px 2px 8px #ed4232, inset -2px -2px 8px #ed4232;
  transition-duration: .2s;
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 9
Ha aumentado su posición en 6 puestos en CSS (en relación al último mes)
Gráfica de CSS

Diseño responsive

Publicado por valentin (2 intervenciones) el 25/09/2020 22:12:51
Muchas gracias. Me fue de gran ayuda su información.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar