I created a simple slideshow, but upon resizing the browser. Images get cropped. I tried all different ways, but couldn't make it.
Here is a sample of html code:
<div class="carousel">
<i class="fas fa-chevron-left" id="prevBtn"></i>
<i class="fas fa-chevron-right" id="nextBtn"></i>
<div class="carousel-inner">
<div class="slide-item">
<div class="caption">
<h1>First Slide</h1>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit.</p>
</div>
<img src="https://www.w3schools.com/bootstrap4/ny.jpg" width="100%" alt="">
</div>
</div>
...
</div>
here is the css code:
.carousel {
position: relative;
width: 992px;
height: 400px;
margin: 0 auto;
padding: 0;
overflow: hidden;
.carousel-inner {
display: flex;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
margin: 0px auto;
.slide-item {
position: relative;
display: inline-block;
flex-direction: column;
justify-content: center;
text-align: center;
align-items: center;
img {
width: 992px;
// height: 400px;
}
...
#media (max-width: 576px) {
.container,
.carousel,
.carousel-inner,
.slide-item {
max-width: 540px;
}
}
#media (min-width: 576px) {
.container,
.carousel,
.carousel-inner,
.slide-item {
max-width: 540px;
}
}
The slideshow looks fine in bigger screens but as we shrink down the size of browser images get cropped. Here is a codepen. I hope someone can solve it here, Thank you.
Try max-width: 100% in mobile
#media (max-width: 576px) {
.container,
.carousel,
.carousel-inner,
.slide-item {
max-width: 100%;
}
DEMO HERE
Related
I'm trying to put a form on a div where I have an image:Form on the image
The problem is that I cannot float the form to the right side and also the form is under the other divs just as the image I've also attached here:
Form under other divs
.slider__size {
overflow: hidden;
height: 570px;
position: relative;
font-family: "DINNextLTProLight";
}
.slider__img__position {
justify-content:center;
align-items:center;
display: flex;
position: absolute;
}
.slider__consolidado__img__position {
justify-content:center;
align-items:right;
display: flex;
position: absolute;
}
.img-responsive, .thumbnail a>img, .thumbnail>img {
display: block;
height: auto;
margin: auto;
position: relative;
}
.title__box {
padding-top:200px;
position: absolute;
padding-left: 50px;
}
.h1__home span{
color: white;
font-size: 50px;
letter-spacing: 1px;
font-weight: bolder;
}
#media (min-width: 600px) and (max-width: 992px) {
.img-responsive, .thumbnail a>img, .thumbnail>img {
max-width: 150%;
height: auto;
position: relative;
margin: auto;
}
}
#media (min-width: 400px) and (max-width: 600px) {
.img-responsive, .thumbnail a>img, .thumbnail>img {
max-width: 250%;
}
}
#media (max-width: 400px) {
.img-responsive, .thumbnail a>img, .thumbnail>img {
max-width: 300%;
height: auto;
position: relative;
margin: auto;
}
#media (max-width: 300px) {
.img-responsive, .thumbnail a>img, .thumbnail>img {
max-width: 400%;
}
}
}
#media (min-width: 768px) {
.navbar-fixed-bottom { display: none;}
}
#media (min-width:768px){
.form__consolidado__color {
margin-top: 120px;
position: absolute;
margin-left: 20px;
box-shadow: 0 0 6px 0px black;
}
}
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 slider__size">
<div class="slider__consolidado__img__position">
<img class="img-responsive img__blend__filter" src="/slider_notebook.jpeg"
alt="Crédito Família">
</div>
<div class="title__box">
<h1 class="h1__home"><span>Comece<br>a realizar<br>sonhos</span</h1>
<button class="btn-default btn-padding btn__slider__color_orange">
Saiba mais
</button>
</div>
</div>
<div class="col-xs-12 col-sm-6 form__consolidado__color">
<h2 class="form__title">Lorem Ipsum</h2>
<h3 class="form__subtitle">What's Lorem Ipsum</h3>
<form data-toggle="validator" role="form" name="contato" action="" method="POST">
<div class="form-group row">..... </div>
<div class="row">
<div class="col-sm-12 div__info__color">
<h2 class="text__blue__h2">.....</h2>
<p class="text__grey__14">......</p>
</div>
The problem of the form being under other divs can be solved by setting the "z-index" property of the div containing the form to a high value which will make the form appear on the first level
z-index: 100
.col-xs-12.col-sm-6.form__consolidado__color {
float: right;
}
I solved the float problem with margin-left:45%;
I have a layout that is utilizing flex to hold images of varying sizes together.
However, when I resize the browser in Firefox the images don't scale evenly.
I have read a lot of posts about what causes the issue, but I am having a difficult time finding the solution for my particular scenario in the sea of information. Anyone have any ideas?
Image of where the breaks are happening in firefox.
*{box-sizing: border-box;}
.container{
max-width: 1360px;
margin: 0 auto;
}
img{
border:2px solid white;
}
.flex-row {
justify-content: flex-start;
align-items: flex-start;
width: 100%;
display: flex;
flex-direction: row;
}
.flex-column{
align-items: flex-start;
height: 100%;
max-width: 1360px;
display: flex;
flex-direction: column;
}
#media (max-width: 600px) {
.flex-column, .flex-row{
display: block;
}
img{
width: 100%;
}
}
<div class="container">
<div class="flex-row row">
<div class="flex-column">
<div><img src="https://placehold.it/548x227"></div>
<div><img src="https://placehold.it/548x459"></div>
</div>
<div class="flex-column">
<div class="flex-row">
<div><img src="https://placehold.it/812x459"></div>
</div>
<div class="flex-row bug">
<div><img src="https://placehold.it/406x227"></div>
<div><img src="https://placehold.it/406x227"></div>
</div>
</div>
</div>
<div class="flex-row row">
<div><img src="https://placehold.it/812x459"></div>
<div><img src="https://placehold.it/548x459"></div>
</div>
</div>
Here is a link to the code: https://codepen.io/enigmas2/pen/zZYPJj
i'm pretty sure firefox's flex-box is bugged out. columns don't seem to work properly.
despite that, you can kind of achieve the same thing using the float property. it took more code than i expected, however.
a potential issue is that a lot of elements have fixed heights. as i mentioned before, too, another issue with doing it this way is that images will be cropped. (notice the ikea and cheerio logos. it's because their widths far outweighs their heights).
here is a codepen.
body {
margin: 0;
}
#container {
width: 75vw;
height: 1145px;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
#row-one {
width: 75vw;
display: block;
}
#left-column {
width: 40.294117647058823529411764705882%;
height: 686px;
float: left;
display: flex;
flex-direction: column;
}
#top-left-image {
width: 100%;
height: 227px;
background: url('https://i.ytimg.com/vi/cNGG2SswaKo/maxresdefault.jpg') center/cover;
}
#middle-left-image {
width: 100%;
height: 459px;
background: url('https://s-media-cache-ak0.pinimg.com/originals/8b/da/34/8bda3460f271a77a54b4cfc08583b1fc.jpg') center/cover;
}
#right-column {
width: 59.705882352941176470588235294118%;
height: 686px;
float: right;
display: flex;
flex-direction: column;
}
#top-right-image {
width: 100%;
height: 459px;
background: url('http://cdn.designcrowd.com.s3.amazonaws.com/blog/Famous-Purple-Logos/1-famous-purple-logos.png') center/cover;
}
#right-column-row {
width: 100%;
}
#middle-middle-image {
width: 50%;
height: 227px;
float: left;
background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Ikea_logo.svg/1024px-Ikea_logo.svg.png') center/cover;
}
#middle-right-image {
width: 50%;
height: 227px;
float: right;
background: url('https://s-media-cache-ak0.pinimg.com/originals/f9/bd/c8/f9bdc85df698cd33535f3517659b9c03.jpg') center/cover;
}
#row-two {
width: 75vw;
height: 459px;
display: block;
}
#bottom-left-image {
width: 59.705882352941176470588235294118%;
height: 459px;
float: left;
background: url('http://logok.org/wp-content/uploads/2014/11/Sprite-logo-2014.png') center/cover;
}
#bottom-right-image {
width: 40.294117647058823529411764705882%;
height: 459px;
float: right;
background: url('https://s-media-cache-ak0.pinimg.com/736x/58/6f/a9/586fa96b662feb46fd10d179a3f5308d.jpg') center/cover;
}
#media screen and (max-width: 768px) {
#left-column, #right-column, #right-column-row, #bottom-left-image, #bottom-right-image {
width: 100%;
float: none;
}
.some-images {
width: 100%;
}
}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="a.css">
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
</head>
<body>
<div id="container">
<div id="row-one">
<div id="left-column">
<div class="not-all-images" id="top-left-image"></div>
<div class="not-all-images" id="middle-left-image"></div>
</div>
<div id="right-column">
<div class="not-all-images" id="top-right-image"></div>
<div id="right-column-row">
<div id="middle-middle-image"></div>
<div id="middle-right-image"></div>
</div>
</div>
<div>
<div id="row-two">
<div class="not-all-images" id="bottom-left-image"></div>
<div class="not-all-images" id="bottom-right-image"></div>
</div>
</div>
</body>
</html>
Problem: On the mobile version, the image is stretching on Portrait mode. As you can see below, it looks compressed.
On landscape mode, the image does not look stretched and looks exactly as the desktop version of the site.
I am using bootstrap and the images have class img-responsive and it does not work.
Below is the css that I wrote. I have tried setting background-size:contain, and some other approaches but did not render desired results. This project uses Coldfusion and Mura (CMS).
UPDATE
The following css is being used in an attempt to make it responsive:
#media (min-width: 1024px) #homepage .carousel .item img {
width:100%;
height:auto;
}
media (min-width:769px) and (max-width:980px) {
#homepage .carousel .item img {
max-width: 100%;
min-height: 100%;
height: auto;
margin-top: 154px !important;
}
}
#media (max-width: 751px) and (orientation: landscape) {
.override-hidden-xs1 {
display: block;
}
.carousel-inner {
width: 100% !important;
}
.fixNext {
margin-right: 0px;
}
.carouselCaption {
margin-top: 120px !important;
}
.h4Font {
font-size: 16px !important;
}
.upcoming-events-image {
max-width: 180px;
max-height: 180px;
width: 22% !important;
margin-left: 340px !important;
}
.image-margin-top {
margin-top: 170px !important;
display: inline-block;
}
}
#media (max-width: 767px) {
#homepage .carousel .item {
height: 200px;
margin-top: 241px;
}
#homepage .carousel .item img {
max-width: 100%;
height: auto;
display: block;
}
}
#media (max-width: 767px) and (orientation: landscape) {
#homepage .carousel .item {
height: 200px;
margin-top: 311px;
}
}
#media (min-width: 768px) and (max-width: 980px) {
.company-logo {
width: 400px;
}
#homepage .carousel .item img {
/*max-width: 1200px;*/
max-width: 100%;
min-height: 100%;
padding-top: 162px;
}
#homepage .carousel .carousel-caption {
margin-left: 64px;
}
.image-margin-top {
margin-top: 57px !important;
}
.changePosition {
margin-top: -193px !important;
}
}
#media (min-width: 920px) {
.company-logo {
width: 400px;
}
#homepage .carousel .item img {
/*max-width: 1200px;*/
max-width: 100%;
min-height: 100%;
}
}
Below is the coldfusion code where it calls the images form the CMS:
<div class="row carousel-inner padding-topImage">
<cfset local.iterator.reset()>
<cfset local.idx=0>
<cfloop condition="local.iterator.hasNext()">
<cfset local.item=iterator.next()>
<cfif ListFindNoCase( 'jpg,jpeg,gif,png', ListLast(local.item.getImageURL(), '.'))>
<div class="row item img-responsive<cfif local.idx eq 0> active</cfif>">
<img src="#local.item.getImageURL(argumentCollection=local.imageArgs)#" alt="#HTMLEditFormat(local.item.getTitle())#">
<cfif arguments.showCaption>
<div class="container">
<div class="carousel-caption carousel-caption1">
<div>
<!--- <h3>#HTMLEditFormat(local.item.getTitle())#</h3> --->
<div class="visible-xs">
<!---<h2>#HTMLEditFormat(local.item.getTitle())#</h2>--->
</div>
<div class="hidden-xs">#local.item.getSummary()#
<!--- #local.item.getBody()# --->
<!---<p><a class="btn btn-larg btn-primary" href="#local.item.getURL()#">Read More</a></p>--->
</div>
<!---<div class="override-hidden-xs1 carouselCaption" style="color:##000"><span class="h4Font">#HTMLEditFormat(local.item.getTitle())#</span>
</div>--->
</div>
</div>
</div>
</cfif>
</div>
<cfset local.idx++>
</cfif>
</cfloop>
</div>
UPDATE
Here is the issue I am having but I am not able to get around it.
The height is fixed and so I tried to height: auto but the images in the carousel disappears.
How would I modify the css so that the background height is dependent on the image being resize based on the screen size.
Here is the modified css:
#media (max-width: 747px){
#homepage .carousel .item img{
margin-top: 71px !important;
max-width:0px;
min-height:0%;
}/*
#homepage .carousel .item {
height:180px !important;
}*/
.carousel-inner {
height:auto;
}
}
#media (min-width: 748px){
#homepage .carousel .item img{
max-width:0px;
min-height:0%;
}/*
#homepage .carousel .item {
height:180px !important;
}*/
}
#media (max-width: 1024px) and (min-width: 768px){
#homepage .carousel .item {
width: 100% !important;
/*margin-top: 20px !important;*/
height:396px !important;
}
}
/*#media (min-width:992px) and (max-width:1363px){
#homepage .carousel .item img {
/* width: 100% !important;
margin-top: 15px !important;
max-height: auto;
max-height: 100%;
min-height: 80%;
}
}
#media (min-width:1024px) and (max-width:1255px){
}*/
#media (min-width: 1024px){
#homepage .carousel .item img {
/* width: 100% !important; */
margin-top: 15px !important;
max-height: auto;
max-height: 100%;
min-height: 80%;
}
}
#media (max-width:1263px) and (min-width:1024px){
#homepage .carousel .item{ height:500px !important; }
#homepage .carousel .carousel-caption {
left: 100px;
top: 80px;
width: 500px;
}
}
#media (min-width:1264px) and (max-width:1363px){
#homepage .carousel .item{ height:502px !important; }
#homepage .carousel .carousel-caption {
left: 99px;
top: 100px;
}
}
#media (min-width:1364px) and (max-width:1641px){
#homepage .carousel .item{ height:540px !important; }
#homepage .carousel .carousel-caption {
left: 170px;
top: 120px;
width: 500px;
}
#homepage .carousel .carousel-caption {
left: 170px;
top: 80px;
width: 500px;
}
}
#media (min-width:1642px){
#homepage .carousel .item{ height:650px !important; }
#homepage .carousel .carousel-caption {
left: 170px;
top: 120px;
width: 500px;
}
}
<div class="row carousel-inner padding-topImage">
<div class="row item myclass">
<img src="/Regal-en-us/cache/file/90A5069B-155D-0201-11BF135B13F69E9A_W1280_H500.jpg" alt="Real People, Real Solutions See how we've helped make a difference in the lives of our members.">
<div class="container">
<div class="carousel-caption carousel-caption1">
<div>
<div class="visible-xs"></div>
<div class="hidden-xs"><h1 class="titleSlide"><br>
Real People,<br>
Real Solutions</h1>
<p class="content1">See how we’ve helped make a difference in the lives of our members.</p>
<p style="font-size: 12px; color: #ffffff;"> </p>
<p><a class="btn btn-info1 styleText btn-primary" href="/index.cfm/doctor-finder/" role="button">Read More</a></p>
<!---<p style="font-size: 12px; color: #ffffff;"> </p>
<p><a class="btn btn-info" href="/index.cfm/doctor-finder/" role="button">Read More</a></p>--->
</div>
</div>
</div>
</div>
</div>
<div class="row item myclass">
<img src="/Regal-en-us/cache/file/9CFFC7AA-155D-0201-119470C3C01460AE_W1280_H500.jpg" alt="Need an Urgent Care Center? There is one right in your neighborhood – and we will help you find it.">
<div class="container">
<div class="carousel-caption carousel-caption1">
<div>
<div class="visible-xs"></div>
<div class="hidden-xs"><h1 class="titleSlide"><br>
<h1>Need an Urgent Care Center?</h1>
<p class="content1">There is one right in your neighborhood –<br>
and we will help you find it.</p>
<div class="embeddedContent oembed-provider-"> </div>
<!---<p style="font-size: 12px; color: #ffffff;"> </p>
<p><a class="btn btn-info1 styleText" href="http://oc2-web03/index.cfm/doctor-finder/" role="button">Find an Urgent Care</a></p>---><!---<p style="font-size: 12px; color: #686868;"> </p>--->
<p><a class="btn btn-info1 slideText btn-primary urgentButton" href="/index.cfm/urgent-care-finder/" role="button">Find an Urgent Care</a></p>
</div>
</div>
</div>
</div>
</div>
<div class="row item myclass active">
<img src="/Regal-en-us/cache/file/9CFD4EC1-155D-0201-11C0E45BAE92654E_W1280_H500.jpg" alt="Looking for a Doctor? We have just the right one for you.">
<div class="container">
<div class="carousel-caption carousel-caption1">
<div>
<div class="visible-xs"></div>
<div class="hidden-xs"><h1 class="titleSlide"><br>
Looking for a doctor?</h1>
<p class="content1">We have just the right one for you.</p>
<!---<p style="font-size: 12px; color: #ffffff;"> </p>
<p><a class="btn btn-info1 styleText" href="/index.cfm/doctor-finder/" role="button">Read More\\\</a></p>--->
<p style="font-size: 12px; color: #686868;"> </p>
<p><a class="btn btn-info1 slideText btn-primary" href="/index.cfm/doctor-finder/" role="button">Find a Doctor Now</a></p>
</div>
</div>
</div>
</div>
</div>
<div class="row item myclass">
<img src="/Regal-en-us/cache/file/22E66EFF-155D-0201-11F1D4090927E676_W1280_H500.jpg" alt="Snow Machines Run as Winter Winds Down">
<div class="container">
<div class="carousel-caption carousel-caption1">
<div>
<div class="visible-xs"></div>
<div class="hidden-xs"><p>Curabitur ut suscipit tellus. Maecenas rhoncus, ante vitae vehicula vestibulum, metus sapien dapibus tellus, et mattis dolor neque vitae nisl.</p>
</div>
</div>
</div>
</div>
</div>
</div>
Because of the fixed height, the following is occuring in the mobile and tablet version. I have tried to remove the item classs that is causing the issue but as mentioned, it is makes the carousel to disappear
Any help would be appreciated
As a rule of thumb, you should not specify the height for any of carousel components or set them to auto what causes the stretch is the [max/min]-height: 100% in these components:
.carousel-inner {
height:auto;
}
.carousel .item {
height: auto;
}
.carousel .item img {
height:auto;
}
This concept does not only apply to carousels. When designing classes, keep the height untouched or auto.
For example:
.give-me-the-bounty
{
width: 100%;
height:auto;
}
Set either height or width but not both. The image will scale itself and retain aspect ratio
Ok, forget the other approach, use inline styles:
<div style="background-image: url('#local.item.getImageURL(argumentCollection=local.imageArgs)#')"></div>
and then on your css use whatever styles you want
Try to add this code:
#media (max-width: 767px)
#homepage .carousel .item img {
object-fit: cover;
}
All you have to do is set the width of image and let the image fix it self and maintain the ratio.
I have 3 column grid with images using flexbox. The issue I encountered is how to properly put smaller image in the middle column to the bottom and the center text vertically in the rest space using flexbox.
I have very ugly solution, which quite unresponsive, so I sure the is better solution for this. Read some articles and watch 3 video courses about flexbox, but didn't found a case with such situation.
Also tried to make smaller image absolute, but then I couldn't center text vertically as I wanted.
Would be grateful for any suggestions.
.container{
max-width: 90%;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
}
img {
width: 100%;
height: 100%;
display: block;
}
.fe2{
flex: 1;
text-align: center;
}
.flex-cont-inner {
display: flex;
flex-flow: column;
height: 100%;
}
.flex-cont-inner img {
height: initial;
}
.message{
font-size: 2.3vw;
margin: 0 auto;
}
.message p {
color: blue;
font-size: 2vw;
max-width: 80%;
margin: 0 auto;
padding: 34.5% 0px;
}
.author{
position: relative;
}
.author:after{
content: 'ANONYMUS';
position: absolute;
font-size: 1vw;
color:red;
top: 140%;
}
<div class="container">
<div class="fe2">
<img src="http://lorempixel.com/output/nightlife-h-c-500-700-3.jpg" alt="">
</div>
<div class="fe2 no-end">
<div class="flex-cont-inner">
<div class="message">
<p>Lorem ipsum dolor sit amet, consecte adipng elit. Voluptas doloremque dig<span class="author">nissimos </span>repreh!</p>
</div>
<img src="http://lorempixel.com/output/city-q-c-500-200-4.jpg" alt="">
</div>
</div>
<div class="fe2">
<img src="http://lorempixel.com/output/nightlife-h-c-500-700-2.jpg" alt="">
</div>
</div>
You need to use margin-top: auto; in both your message and your image. There's a really good explanation by Michael_B here about the use of auto margins with flexbox.
jsFiddle
CODE SNIPPET:
.container {
max-width: 90%;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
}
img {
width: 100%;
height: 100%;
display: block;
}
.fe2 {
flex: 1;
text-align: center;
}
.flex-cont-inner {
display: flex;
flex-flow: column;
height: 100%;
}
.flex-cont-inner img {
height: initial;
margin-top: auto;
}
.message {
font-size: 2.3vw;
margin-top: auto;
}
.message p {
color: blue;
font-size: 2vw;
}
.author {
position: relative;
}
.author:after {
content: 'ANONYMUS';
position: absolute;
font-size: 1vw;
color: red;
top: 140%;
}
<div class="container">
<div class="fe2">
<img src="http://lorempixel.com/output/nightlife-h-c-500-700-3.jpg" alt="">
</div>
<div class="fe2 no-end">
<div class="flex-cont-inner">
<div class="message">
<p>Lorem ipsum dolor sit amet, consecte adipng elit. Voluptas doloremque dig<span class="author">nissimos </span>repreh!</p>
</div>
<img src="http://lorempixel.com/output/city-q-c-500-200-4.jpg" alt="">
</div>
</div>
<div class="fe2">
<img src="http://lorempixel.com/output/nightlife-h-c-500-700-2.jpg" alt="">
</div>
</div>
I'm working hard on making a responsive image carousel but in the last stage (which I will explain) I can't get something to work. First let me give you what I have now, and then I will explain what suppose to happen.
html, body {
margin: 0;
overflow-x: hidden;
}
.vp-carousel {
width: 1000px;
height: 228px;
overflow: hidden;
margin-left: 50%;
transform: translate(-50%);
margin-top: 150px;
position: relative;
}
.carousel-wrapper {
height: 228px;
width: calc((1000px / 3) * 4);
}
.carousel-box {
display: inline-block;
width: calc(1000px / 3);
height: 100%;
margin-right: -4px;
position: relative;
}
.carousel-box img {height: 100%; width: 100%; }
.title {
position: absolute;
color: white;
z-index: 2;
height: 60px;
width: 100%;
text-align: center;
line-height: 30px;
top: calc(100% - 60px);
}
.mask {
width: 100%;;
height: 100%;
background-color: rgba(0,0,0,0.5);
position: absolute;
z-index: 1
}
#media screen and (max-width: 1080px) {
.vp-carousel {
width: calc(1000px * 0.66);
}
}
#media screen and (max-width: 700px) {
.vp-carousel {
width: calc(1000px * 0.33);
}
}
<div class="portfolio">
<div class="vp-carousel">
<div class="carousel-wrapper">
<div class="carousel-box">
<div class="title">
<p>Joomla! Website</p>
</div>
<div class="mask"></div>
<img src="http://www.hdwallpapers.in/walls/autumn_bench-HD.jpg">
</div>
<div class="carousel-box">
<div class="title">
<p>Joomla! Website</p>
</div>
<div class="mask"></div>
<img src="http://www.hdwallpapers.in/walls/autumn_bench-HD.jpg">
</div>
<div class="carousel-box">
<div class="title">
<p>Joomla! Website</p>
</div>
<div class="mask"></div>
<img src="http://www.hdwallpapers.in/walls/autumn_bench-HD.jpg">
</div>
<div class="carousel-box">
<div class="title">
<p>Joomla! Website</p>
</div>
<div class="mask"></div>
<img src="http://www.hdwallpapers.in/walls/autumn_bench-HD.jpg">
</div>
</div>
</div>
</div>
So what you see here is my simplified image carousel (to make it more clear), and in the last stage it show only one image (good!) but it's very small relative to the screen width of 700px (media query). What I want it to do is that it all increases to a bigger size (in ratio) and when the screen width gets smaller the image carousel decreases in size (in ratio).