building a neat responsive webpage requires good resources, images are important since it grabs the user’s attention so presenting your images on the best way is a crucial task.
now, how do we come up with the best picture dimensions? I mean sometimes pictures with big dimensions on small blocks overflow and get presented out of context! here are some examples with the code below
<section class="section-features">
<ul class="showcase">
<li class="showcase-li">
<figure class="showcase-figure">
<img class="showcase-img" src="resources/img/ (1).jpg" alt="">
</figure>
</li>
<li class="showcase-li">
<figure class="showcase-figure">
<img class="showcase-img" src="resources/img/ (2).jpg" alt="">
</figure>
</li>
<li class="showcase-li">
<figure class="showcase-figure">
<img class="showcase-img" src="resources/img/ (3).jpg" alt="">
</figure>
</li>
<li class="showcase-li">
<figure class="showcase-figure">
<img class="showcase-img" src="resources/img/ (4).jpg" alt="">
</figure>
</li>
</ul>
</section>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.showcase{
width: 100%;
list-style: none;
}
.showcase-li{
display: block;
float: left;
width: 25%;
}
.showcase-li:after{
clear: both;
}
.showcase-figure{
width:100%;
overflow: hidden;
background: #000;
margin: 0;
}
.showcase-img{
width: 100%;
height: auto;
transform: scale(1.15);
opacity: 0.7;
transition: 0.5s;
}
.showcase-img:hover{
transform: scale(1.03);
opacity: 1;
}
using pictures with big deminsions like 4000*2700 would end up with pictures out of context blocks
using pictures with small dimensions 260*260 would end up with long pixly pictures
but when using pictres with 800*600 was perfect
now how to guess the best numbers for these dimensions?
note: I’ve never changed the HTML code nor CSS styles but only the pictures src links