1

I have made myself a website with simple html & css to enchance my skills in this area while also learning responsive design.

I want to display these 3 images, on my mobile view also, but they keep going on the right side which causes really much whitespace on the right side, and the images not being correctly displayed where I want it to be. It currently goes to the right side, which causing whitespace on the right side. How to accomplish to fix this?

I have tried media querieres for responsiveness with the following snippet.

@media only screen and (max-width:700px) {
   .articles {
    margin: 50px 30px;
   }
   .article {
    left: 0;
    width:100%;
   }
}

And my html for the images.

<!-- ROW 1 -->

<section class="articles">


    <article class="article">
      <img class="article-image" src="/images/layer-2.jpg">
      <div class="article-text-wrapper">
        <h3 class="article-title">Issue 1</h3>
        <div class="article-description">

        </div>

      </div>
    </article>

    <article class="article">
      <img class="article-image" src="/images/layer-4.jpg">
      <div class="article-text-wrapper">
        <h3 class="article-title">Issue 2</h3>


        </div>

      </div>
    </article>

    <article class="article">
      <img class="article-image" src="/images/layer-6.jpg">
      <div class="article-text-wrapper">
        <h3 class="article-title">issue 3</h3>

      </div>
    </article>

  </section>
Andrew yed
  • 33
  • 3

1 Answers1

3

Give the img width: 100%:

.article img {
  width: 100%;
}
VXp
  • 11,598
  • 6
  • 31
  • 46
Gregor Ojstersek
  • 1,369
  • 7
  • 12