Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
This is how it's done
<picture>
<source media="(max-width: 799px)" srcset="elva-480w-close-portrait.jpg">
<source media="(min-width: 800px)" srcset="elva-800w.jpg">
<img src="elva-800w.jpg" alt="Chris standing up holding his daughter Elva">
</picture>
Through @media
, if I correctly understood the essence of your question.
<div class="carousel-item active" role="listbox">
<img src="img/slider/header.jpg" class="desktop">
<img src="img/slider/header2.jpg" class="mobile">
</div>
<style>
img.desktop {
display: block;
}
img.mobile {
display: none;
}
@media (max-width: 768px) {
img.desktop {
display: none;
}
img.mobile {
display: block;
}
}
</style>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question