Здравствуйте, я новичок в веб-разработке, прошу вашей помощи / совета.Я создал эти 2 столбца (элемент 1 представляет собой изображение, а элемент 2 - текст). В мобильном представлении я хочу, чтобы он изменил свой порядок так, чтобы (элемент 2 был сверху, а элемент 1 - снизу), я попыталсягибкая упаковка: обратная;но я хочу знать, есть ли возможный способ с кодом, который я сделал.
Спасибо заранее!извините за этот вопрос.Я просто пытаюсь найти другой путь.Аригато Гозаймазу !!!
вот ссылка: https://jsfiddle.net/w2ybd7ax/
для кода,
HTML:
<div class="grid__items">
<div class="item__1">
<img src="https://via.placeholder.com/457x262" alt="">
</div>
<div class="item__2">
<h2>Block Heading</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
SCSS:
.grid__items {
margin: 0 auto;
width: 100%;
display: block;
letter-spacing: 0;
font-size: 0;
.item__1 {
margin: 0 auto;
width: 43%;
display: inline-block;
vertical-align: top;
margin: 0% 0 1% 0%;
&.second-grid {
width: 43%;
margin: 0% 0 1% 3%;
}
img {
width: 100%;
}
}
.item__2 {
margin: 0 auto;
width: 54%;
display: inline-block;
margin: 0% 0 1% 3%;
&.second-grid {
width: 54%;
margin: 0% 0 1% 0%;
}
h2 {
margin-top: 0;
margin-bottom: 10px;
font-size: 20px;
font-weight: 600;
letter-spacing: 0.025em;
}
p {
font-size: 16px;
line-height: 1.94;
letter-spacing: 0.025em;
}
}
}
@media screen and (min-width: 320px) and (max-width:767px) {
.grid__items {
margin: 0 auto;
width: 100%;
display: block;
letter-spacing: 0;
font-size: 0;
.item__1 {
margin: 0 auto;
width: 100%;
display: block;
vertical-align: top;
margin: 0% 0 5% 0%;
&.second-grid {
width: 100%;
margin: 0% 0 1% 0%;
}
img {
width: 100%;
}
}
.item__2 {
margin: 0 auto;
width: 100%;
display: block;
margin: 0% 0 1% 0%;
&.second-grid {
width: 100%;
margin: 0% 0 1% 0%;
}
h2 {
margin-bottom: 10px;
font-size: 20px;
font-weight: 600;
letter-spacing: 0.025em;
}
p {
font-size: 16px;
line-height: 1.94;
letter-spacing: 0.025em;
}
}
}
}