Okay guys I have a challenge, can't seem to figure it out. I have 3 images with text that have to show next to eachother, but when at screen (max-width: 768px) the images have to show under eachother with the 1st and 3rd image the text has to be to the right with image to the next and for the 2nd image the text to the left and image to the right. So like this:
另外:图片和文字必须有背景色,所以我不能把它们放在一个段落中,它们都必须是单独的方框!!
我以为flexbox是最好的解决方案,但我就是不想加入.
.fish{
grid-column: span 13;
display: flex;
}
.fishpics{
max-width: 100%;
height: 200px;
}
figure{
background-color: darkred;
margin: 5px;
flex-wrap: 1;
}
<div class="fish">
<figure>
<img class="fishpics" src="img/fish1.jpg">
<h3>tekst</h3>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Aperiam itaque saepe molestias at iusto iure illo voluptate? Veniam, doloribus mollitia. Nihil, repellendus aut? Accusantium dolorum tempora, sunt minus itaque id?</p>
</figure>
<figure>
<img class="fishpics" src="img/fish2.jpg">
<h3>tekst</h3>
<p class="pright">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Aperiam itaque saepe molestias at iusto iure illo voluptate? Veniam, doloribus mollitia. Nihil, repellendus aut? Accusantium dolorum tempora, sunt minus itaque id?</p>
</figure>
<figure>
<img class="fishpics" src="img/fish3.jpg">
<h3>tekst</h3>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Aperiam itaque saepe molestias at iusto iure illo voluptate? Veniam, doloribus mollitia. Nihil, repellendus aut? Accusantium dolorum tempora, sunt minus itaque id?</p>
</figure>
</div>
正如你所看到的,看起来我还没有try 过,但我刚刚删除了我无助的try .