This code below is responsive and resizes etc. But I'm looking for some real simple CSS to resize when on desktop and mobile.
I get that I can muck with the CSS from the header link w3.css, but there has to be a better way to just easily display some things on desktop vs mobile.
And mobile defaults to displaying inline, yet on desktop displays as 3 rows.
Is there an easier solution than the w3 school?
Just trying to do a couple rows, that then resize to single on mobile...
Link rel goes in header:
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<div class="w3-row">
<div class="w3-third w3-container w3-green" align=center>
<h2>w3-third</h2>
Stuff here too
</div>
<div class="w3-third w3-container w3-red">
<h2>w3-third</h2>
</div>
<div class="w3-third w3-container w3-blue">
<h2>w3-third</h2>
</div>
</div>
I've got to here below with help from Ahmed and Raven. But not centering. I also changed to 90% to allow for some spacing.
Works for the most part, but not centering on larger width. Does flip to single rows when smaller width, which is good. I'm looking for that mobile reponse like that. Easy code so far to, and I can easily manipulate.
CSS
@media only screen and (min-width:320px) and (max-width: 600px) {
.display {
width: 90%;
background: #f1f1f1;
padding: 10px;
border: solid 2px #998E67;
margin: 5px;
}
}
@media only screen and (min-width:600px) {
.display {
float: left;
width: 30%;
background: #f1f1f1;
padding: 10px;
border: solid 2px #998E67;
margin: 5px;
}
}
Not sure if I need this outside div align center, doesn't seem to work.
<div align=center style="border: 1px solid ##000">
<div class="display" align=center>
<img src="../../images/img.png" height="55" border="0">
<h2>This is first</h2>
</div>
<div class="display"">
<h2>This is second</h2>
</div>
<div class="display">
<h2>This is Third</h2>
<img src="../../images/image" height="55" border="0">
</div>
</div>