Grid werkt niet meer
Daarnaast krijg ik ook foutmeldingen bij de validator 2 van de youtube filmpjes.
https://i.postimg.cc/vmK6FWz8/Schermafbeelding-2025-03-26-091656.png
De lay-out van de 3 afbeeldingen en 2 filmpjes moet had de volgende lay-outs.
Vanaf 1024px alles naast elkaar met ruimte ertussen.
In 768px de 3 foto's naast elkaar en de 2 filmpjes eronder over de hele breedte.
In 320px alles onder elkaar.
De 320px is onder elkaar maar de witruimte is weg rechts.
Mijn vraag is duss of iemand mij kan helpen dit grid probleem op te lossen?
Code (php)
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
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
<!-- Foto- en video sectie -->
<section class="media">
<h2>Foto's en video's</h2>
<div class="grid">
<img src="Media/Index/Photo/Girls-on-car.jpg" alt="Meiden zitten op een auto">
<img src="Media/Index/Photo/Navigation.jpg" alt="Navigatie">
<img src="Media/Index/Photo/Pin-location.jpg" alt="Zet de route uitzetten">
</div>
<!-- YouTube Video -->
<div class="video-container">
<iframe width="560" height="315"
src="https://www.youtube.com/embed/75nwHtfxSXI?si=_WpPWU94GMtxiGuw"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
</div>
<div class="video-container">
<iframe width="560" height="315"
src="https://www.youtube.com/embed/xOU1EFf3qik?si=u5A8mnxIjo-ZN88M"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
</div>
</section>
<section class="media">
<h2>Foto's en video's</h2>
<div class="grid">
<img src="Media/Index/Photo/Girls-on-car.jpg" alt="Meiden zitten op een auto">
<img src="Media/Index/Photo/Navigation.jpg" alt="Navigatie">
<img src="Media/Index/Photo/Pin-location.jpg" alt="Zet de route uitzetten">
</div>
<!-- YouTube Video -->
<div class="video-container">
<iframe width="560" height="315"
src="https://www.youtube.com/embed/75nwHtfxSXI?si=_WpPWU94GMtxiGuw"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
</div>
<div class="video-container">
<iframe width="560" height="315"
src="https://www.youtube.com/embed/xOU1EFf3qik?si=u5A8mnxIjo-ZN88M"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen>
</iframe>
</div>
</section>
Code (php)
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/* CSS-variabelen */
:root {
--primary-color: #ff6600;
--secondary-color: #333;
--font: 'Roboto', sans-serif;
}
body {
font-family: var(--font);
margin: 0;
padding: 0;
background: #f4f4f4;
}
/* Header en navigatie */
header {
display: flex;
justify-content: space-between;
align-items: center;
background: var(--secondary-color);
padding: 15px 30px;
}
.logo {
display: flex;
align-items: center;
}
.logo h1 {
color: white;
margin-left: 10px;
font-family: "Monoton", sans-serif;
font-weight: 400;
font-style: normal;
}
nav ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
}
nav ul li {
position: relative;
}
nav ul li a {
color: white;
text-decoration: none;
padding: 10px 20px;
display: block;
}
nav ul li a:hover {
background: var(--primary-color);
}
.active {
background-color: #ff6600;
}
/* Submenu */
.submenu {
display: none;
position: absolute;
background: var(--secondary-color);
list-style: none;
padding: 0;
margin: 0;
}
nav ul li:hover .submenu {
display: block;
}
.submenu li a {
padding: 10px;
display: block;
width: 150px;
}
/* Hero afbeelding */
.hero img {
width: 100%;
height: 200px;
display: block;
}
/* Content sectie */
.content {
display: flex;
justify-content: space-around;
align-items: center;
padding: 40px;
margin-right: 20px;
margin-left: 20px;
}
.video-container {
position: relative;
width: 100%;
padding-bottom: 56.25%; /* 16:9 verhouding */
height: 0;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* Foto's en video's */
.media {
padding: 40px;
text-align: center;
}
.media .grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
padding: 20px;
}
.media img, .media video {
width: 100%;
border-radius: 10px;
}
/* Plaatjes met tekst */
.info {
padding: 40px;
}
.row {
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 20px;
}
.row img {
width: 128px;
height: 128px;
}
.reverse {
flex-direction: row-reverse;
}
/* Footer */
footer {
text-align: center;
padding: 20px;
background: var(--secondary-color);
color: white;
}
/* Responsiviteit */
@media (max-width: 1024px) {
.content {
flex-direction: column;
text-align: center;
}
.row {
flex-direction: column;
text-align: center;
}
}
@media (max-width: 768px) {
header {
flex-direction: column;
text-align: center;
}
nav ul {
flex-direction: column;
}
.media {
flex-direction: row;
}
}
@media (max-width: 320px) {
.logo h1 {
font-size: larger;
}
.hero img {
width: 100%;
height: auto;
}
.media .grid {
flex-direction: column;
}
.info {
font-size: small;
}
.row {
flex-direction: column;
}
}
/* Google Maps container */
.map-container {
width: 100%;
height: 400%;
text-align: center;
}
#map {
width: 100%;
height: 100%;
}
/* Contactformulier */
.contact-form {
max-width: 600px;
margin: 40px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
.contact-form h2 {
text-align: center;
color: var(--secondary-color);
}
.contact-form label {
display: block;
margin-top: 10px;
font-weight: bold;
}
.contact-form input,
.contact-form textarea {
width: 100%;
padding: 10px;
margin-top: 5px;
border: 1px solid #ccc;
border-radius: 5px;
font-family: var(--font);
}
.contact-form textarea {
height: 150px;
}
.contact-form button {
width: 100%;
padding: 10px;
margin-top: 15px;
background: var(--primary-color);
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
}
.contact-form button:hover {
background: #e65c00;
}
/* Responsiviteit */
@media (max-width: 768px) {
.contact-form {
width: 90%;
}
}
/* Tabel */
table {
border-collapse: collapse;
width: 100%;
}
th, td {
border: 1px solid #000000;
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: #333;
color: white;
}
.tabel {
display: flex;
justify-content: space-around;
align-items: center;
padding: 40px;
margin-right: 20px;
margin-left: 20px;
}
:root {
--primary-color: #ff6600;
--secondary-color: #333;
--font: 'Roboto', sans-serif;
}
body {
font-family: var(--font);
margin: 0;
padding: 0;
background: #f4f4f4;
}
/* Header en navigatie */
header {
display: flex;
justify-content: space-between;
align-items: center;
background: var(--secondary-color);
padding: 15px 30px;
}
.logo {
display: flex;
align-items: center;
}
.logo h1 {
color: white;
margin-left: 10px;
font-family: "Monoton", sans-serif;
font-weight: 400;
font-style: normal;
}
nav ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
}
nav ul li {
position: relative;
}
nav ul li a {
color: white;
text-decoration: none;
padding: 10px 20px;
display: block;
}
nav ul li a:hover {
background: var(--primary-color);
}
.active {
background-color: #ff6600;
}
/* Submenu */
.submenu {
display: none;
position: absolute;
background: var(--secondary-color);
list-style: none;
padding: 0;
margin: 0;
}
nav ul li:hover .submenu {
display: block;
}
.submenu li a {
padding: 10px;
display: block;
width: 150px;
}
/* Hero afbeelding */
.hero img {
width: 100%;
height: 200px;
display: block;
}
/* Content sectie */
.content {
display: flex;
justify-content: space-around;
align-items: center;
padding: 40px;
margin-right: 20px;
margin-left: 20px;
}
.video-container {
position: relative;
width: 100%;
padding-bottom: 56.25%; /* 16:9 verhouding */
height: 0;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* Foto's en video's */
.media {
padding: 40px;
text-align: center;
}
.media .grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
padding: 20px;
}
.media img, .media video {
width: 100%;
border-radius: 10px;
}
/* Plaatjes met tekst */
.info {
padding: 40px;
}
.row {
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 20px;
}
.row img {
width: 128px;
height: 128px;
}
.reverse {
flex-direction: row-reverse;
}
/* Footer */
footer {
text-align: center;
padding: 20px;
background: var(--secondary-color);
color: white;
}
/* Responsiviteit */
@media (max-width: 1024px) {
.content {
flex-direction: column;
text-align: center;
}
.row {
flex-direction: column;
text-align: center;
}
}
@media (max-width: 768px) {
header {
flex-direction: column;
text-align: center;
}
nav ul {
flex-direction: column;
}
.media {
flex-direction: row;
}
}
@media (max-width: 320px) {
.logo h1 {
font-size: larger;
}
.hero img {
width: 100%;
height: auto;
}
.media .grid {
flex-direction: column;
}
.info {
font-size: small;
}
.row {
flex-direction: column;
}
}
/* Google Maps container */
.map-container {
width: 100%;
height: 400%;
text-align: center;
}
#map {
width: 100%;
height: 100%;
}
/* Contactformulier */
.contact-form {
max-width: 600px;
margin: 40px auto;
padding: 20px;
background: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
.contact-form h2 {
text-align: center;
color: var(--secondary-color);
}
.contact-form label {
display: block;
margin-top: 10px;
font-weight: bold;
}
.contact-form input,
.contact-form textarea {
width: 100%;
padding: 10px;
margin-top: 5px;
border: 1px solid #ccc;
border-radius: 5px;
font-family: var(--font);
}
.contact-form textarea {
height: 150px;
}
.contact-form button {
width: 100%;
padding: 10px;
margin-top: 15px;
background: var(--primary-color);
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
}
.contact-form button:hover {
background: #e65c00;
}
/* Responsiviteit */
@media (max-width: 768px) {
.contact-form {
width: 90%;
}
}
/* Tabel */
table {
border-collapse: collapse;
width: 100%;
}
th, td {
border: 1px solid #000000;
text-align: left;
padding: 8px;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: #333;
color: white;
}
.tabel {
display: flex;
justify-content: space-around;
align-items: center;
padding: 40px;
margin-right: 20px;
margin-left: 20px;
}
Gewijzigd op 26/03/2025 09:26:28 door Alexander Tobe
Had trouwens nog niet toegevoegd wat ik zelf geprobeerd had om het te fixen.
Er komt ook wel wat uit dan maar het wijzigt ook bij oa. 320px de lay-out wat niet de bedoeling is natuurlijk.
De video's blijven ook groot en onder elkaar dan in plaats van naast elkaar.
Bij 1024px:
.media .grid {
grid-template-columns: repeat(3, 1fr);
}
.media .video-container {
grid-template-columns: repeat(2, 1fr);
display: grid;
gap: 20px;
}
Bij 768px:
.media .grid {
grid-template-columns: repeat(3, 1fr);
}
.media .video-container {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
}
iframe {
width: 100%;
height: auto;
}
Gewijzigd op 27/03/2025 10:05:21 door Alexander Tobe
Niemand die wil/kan helpen?
Gewijzigd op 01/04/2025 09:57:30 door - Ariën -
- Ariën - op 01/04/2025 09:56:39:
Als je een testcase kan delen (in bijv. JSfiddle, of een tijdelijke pagina), dan zal het makkelijker werken. Maar hoezo zou je geen bestaand grid-framework gebruiken?
bestaand grid-framework? Ik heb een template gedownload als basis die voor 80% al goed was maar moest er zelf nog dingen aan veranderen en toevoegen.
Hopelijk is deze link goed.
https://jsfiddle.net/alext305/1ojuq5cg/1/
Ik moet de site donderdag online zetten eigenlijk duss hopelijk kan het worden opgelost.
Niemand met de oplossing?