1
I’m willing to let the slider images of Materialize all the same size, but I’m not succeeding. I left this code to make the slider responsive, only the images are different sizes.
CSS
.section-slide .slider .slides{
background-color: transparent;
margin: 0;
height: 700px;
}
.section-slide .slider .slides li img{
height: 100% !important;
width: 100% !important;
background-position: top;
background-size: 100% auto !important;
background-repeat: no-repeat;
}
HTML
<section class="section-slide">
<div class="slider">
<ul class="slides">
<li>
<img src="img/music10.jpeg" class="responsive-img">
<div class="caption center-align top-setting">
<h3>Share Sound</h3>
<div class="divider-cap divider"></div>
<h5 class="light grey-text text-lighten-3">Proporcionando o conhecimento musical,<br>ajudando e produzindo sempre.</h5>
</div>
</li>
<li>
<img src="img/music9.jpeg" class="responsive-img">
<div class="caption left-align">
<h3>Left Aligned Caption</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
<li>
<img src="img/music4.jpg" class="responsive-img">
<div class="caption right-align right-setting">
<h3>Seja sempre o primeiro.</h3>
<h5 class="light grey-text text-lighten-3">Produza mais e seja reconhecido !</h5>
</div>
</li>
<li>
<img src="img/music12.jpeg" class="responsive-img">
<div class="caption center-align">
<h3>This is our big Tagline!</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
</ul>
</div>
</section>
Jquery
$(document).ready( function(){
$('.button-collapse').sideNav(); // Side Nav Mobile
$('.modal').modal(); // Modal
$('.slider').slider({
interval: 6000,
height: 700
});
In your HTML you do not have
.section-slide .slider
– Sam
Oh yes, it is because there is a Section before. I just did not put here.
– Monroe Say
But they’re not the same size in width or height?
– Sam
No, especially when you resize the window, you can see how different their height is. I think this might be because of the original image size.
– Monroe Say
It can be... the script turns the images into background and cuts the ones that are larger than the slider area
– Sam
Previously I had not used height in the script, but the problem was still continuing, and also the slide was overwriting the content for not having set height.
– Monroe Say