Image/content is not contained within a div
P粉983021177
P粉983021177 2024-04-03 10:15:05
0
1
400

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粉983021177
P粉983021177

reply all(1)
P粉231079976

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;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!