I currently have the following HTML and CSS:
HTML
<section id={styles.rowTwo} className={styles.row}>
<h1 className={styles.rowHeaderText}>NAS Component</h1>
<div id={styles.rowTwoContainer}>
<div id={styles.hardwareList}>
<h3>Hardware</h3>
<div id={styles.componentContainer}>
<div id={styles.componentImageContainer}>
<img id={styles.componentImage} src={require('../../img/ram.png')}/>
</div>
<p id={styles.componentText}>RAM: 16GB DDR3 1600Mhz ECC</p>
</div>
</div>
<div id={styles.softwareList}>
<h3>Software</h3>
</div>
</div>
</section>
CSS
.row {
width: 100%;
background-color: green;
display: flex;
flex-direction: column;
}
#rowTwoContainer {
display: flex;
}
#hardwareList {
width: 70%;
}
#softwareList {
width: 30%;
}
#componentContainer {
display: flex;
}
#componentImageContainer {
width: 30%;
}
#componentText {
width: 70%;
}
The issue is that when I resize my browser window, the image on the left does not resize. I would like it to shrink as the size of the browser window changes.
There have been numerous answers on SO that I have tried which allow the image to resize but unfortunately the image becomes stretched when the browser is at a width of 1400px (the width defined for my page).
Extra info:
There is a div
that encapsulates everything shown above that has a width
of 1400px
.
The dimensions of the image are: 38 x 71 pixels.
Thank you for your help.