Я пытаюсь сделать так, чтобы изображения появлялись в моей готовой коробке, которую я создал. Прямо сейчас они слишком широкие и отображаются за пределами моей ширины 50em. Кроме того, они довольно большие по высоте, и я не знаю, является ли это просто изменением изображения или кода. Я использую для этого флексбокс.
Прямо сейчас, без изображений, кажется, что все они находятся в одной строке от использования переноса, но как только изображения добавлены, он перестает работать правильно.
main{
width:50em;
border-style:solid;
display:flex;
}
.images{
display: flex;
flex-direction: row;
flex: 1 1 25em;
flex-wrap: wrap;
flex-grow: 1;
}<!DOCTYPE html>
<html>
<head>
<!-- A meta element naming the Unicode character set you want the browser to use (UTF-8). -->
<meta charset = "UTF-8">
<!-- A link to reset -->
<link rel = "stylesheet" type = "text/css" href = "https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel = "stylesheet" href = "flex.css">
</head>
<body>
<main class = "wrapper">
<header id = "images">
<img src = "student-misc-02.jpg" alt = "student1">
<img src = "student-misc-06.jpg" alt = "student1">
<img src = "student-misc-08.jpg" alt = "student1">
<img src = "student-misc-12.jpg" alt = "student1">
<img src = "student-misc-19.jpg" alt = "student1">
<img src = "student-misc-20.jpg" alt = "student1">
</header>
</main>
</body>
</html> @IcaroHeimig Я пытался сделать по 3 картинки в строке, как вы сделали ниже.






Я исправил код CSS, чтобы он соответствовал вашему коду HTML. Кроме того, в некоторых из ваших правок вы отображали как 3 столбца, последнее правило CSS пытается воспроизвести макет этих 3 столбцов.
main {
width: 50em;
border-style: solid;
display: flex;
}
/* fix the selector to match yout html code using id, not class */
#images {
display: flex;
flex-direction: row;
flex: 1 1 25rem;
flex-wrap: wrap;
flex-grow: 1;
}
/* If you need the three columns as your original question */
#images img {
width: 33%;
margin: auto;
}<!DOCTYPE html>
<html>
<head>
<!-- A meta element naming the Unicode character set you want the browser to use (UTF-8). -->
<meta charset = "UTF-8">
<!-- A link to reset -->
<link rel = "stylesheet" type = "text/css" href = "https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel = "stylesheet" href = "flex.css">
</head>
<body>
<main class = "wrapper">
<header id = "images">
<img src = "http://lorempixel.com/400/200" alt = "student1">
<img src = "http://lorempixel.com/400/200" alt = "student1">
<img src = "http://lorempixel.com/400/200" alt = "student1">
<img src = "http://lorempixel.com/400/200" alt = "student1">
<img src = "http://lorempixel.com/400/200" alt = "student1">
<img src = "http://lorempixel.com/400/200" alt = "student1">
</header>
<section class = "title">
<!--<h1>XD Rountable 2019 Event Calendar</h1>-->
</section>
<footer>
</footer>
</main>
</body>
</html>
вам нужно 3 столбца? И вы использовали
#imagesв качестве идентификатора в заголовке HTML. Но используют как класс.imagesв коде CSS.