I'm diving into the world of HTML, CSS, and JS as I embark on creating a weather application. My vision is to include the temperature, followed by the city and its corresponding weather (accompanied by an icon), and lastly additional details like humidity and wind speed, each in their own separate columns for clarity. However, when attempting to add two more columns within the extra info column, things started to go awry. How can I achieve this layout, where each piece of information is displayed neatly with justified spacing? Here's an excerpt from my code:
Humidity___________________ 30%
In my JSFiddle demo, you'll notice that the last two columns are merged together. How can I address this issue while ensuring that the layout remains responsive based on screen size, adjusting the space-between dynamically without rigid margin values?
* {
background-color: rgb(41, 35, 35);
font-family: 'Rubik', sans-serif;
}
body {
background-color: rgb(41, 35, 35);
position: relative;
display: flex;
height: 96vh;
width: 98vw;
}
p {
color: whitesmoke;
font-size: 32px;
font-weight: 300;
margin: 0;
}
.divSearch {
position: absolute;
top: 0;
right: 0;
}
#searchBar {
width: 260px;
height: 42px;
margin-right: 10px;
}
#searchIcon {
width: 42px;
height: 48px;
background-color: rgb(71, 71, 63)
}
.recentCity {
font-size: 26px;
font-weight: 300;
margin: 12px;
}
.cityStats {
display: flex;
position: absolute;
bottom: 0;
left: 0;
margin-left: 12px;
width: 540px;
text-align: left;
align-items: center;
justify-content: space-around;
}
#temperature {
font-size: 82px;
margin-right: 26px;
}
#temperature span {
font-size: 60px;
font-weight: 300;
}
.divExtraInfo {
max-width: 150px;
min-width: 130px;
}
#spaceBetween {
display: flex;
justify-content: space-between;
}
<div class="cityStats">
<div id="divTemperature">
<p id="temperature"> 19°<span>C</span></p>
</div>
<div class="divExtraInfo">
<p id="city">Rosario</p>
<p id="weatherText"> <span id="weatherIcon">☀</span> Sunny</p>
</div>
<div class="divExtraInfo" id="spaceBetween">
<div>
<p id="windSpeed"> Wind</p>
<p id="humidity">Humidity</p>
</div>
<div>
<p id="windSpeedKM"> 32km/h</p>
<p id="humidity%">62%</p>
</div>
</div>
</div>