I'm trying to include an image inside the first div of the page, but for some reason it's outside the page. All resources are located in flexboxes. When I put text inside that div instead of an image, it works perfectly fine.
I've circled the image and div I'm talking about in red. This code snippet won't show you what I'm talking about because it's not the complete code.
.landing { height: 100vh; display: flex; align-items: center; justify-content: center; } .introWrapper { width: 1000px; } .intro1 { font-size: 25px; text-align: center; font-family: 'Yapari'; align-items: center; justify-content: center; margin-top: 23px; } .intro2 { font-size: 25px; text-align: center; font-family: 'Yapari'; /* font-weight: 72; */ margin-top: 50px; } #introCircle { border: 2px solid black; border-radius: 50%; width: 230px; height: 70px; margin: auto; } .icons { border: 2px solid black; height: 50px; } .icon1 { width: 30px; }
<div id='landing' className={styles.landing}> <div className={styles.introWrapper}> <div className={styles.icons}> <img src={icon1} className={styles.icon1}/> </div> <div id={styles.introCircle}> <h1 className={styles.intro1}>HELLO I'M</h1> </div> <LastName /> <h1 className={styles.intro2}>A FULL STACK DEVELOPER</h1> </div> </div>
P粉2310799762024-04-04 00:53:12
As I understand it, you have already provided a height to the div "icon". Change height
to min-height
.icons { border: 2px solid black; min-height: 50px; }