Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a series of divs that is drawing from data in an array. The array gets mapped over and for each element in the array, the relevant data gets pulled and placed into a div. The problem is the background of the divs seems to be rendering independent of the width of the content. So the content will not fit in the divs; it's being cut off. This only happens on Safari; the divs are rendering just fine on Chrome. How can I resolve this issue? For reference, the site is up at www.jevoncochran.com/projects.

This is how the divs are being rendered:

<div className={styles["projects-ps-technologies-container"]}>
  {props.technologies.map((t) => (
    <div className={styles["projects-ps-tech"]}>{t}</div>
  ))}
</div>

The CSS that controls the divs:

.projects-ps-technologies-container {
  // border: 1px dashed black;
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  margin-bottom: 2%;
}

.projects-ps-tech {
  background-color: #2c3259;
  min-width: 8%;
  color: #fff;
  padding: 2%;
  font-size: 1.3rem;
  margin-right: 2%;
  margin-bottom: 2%;
}

Safari screenshot (this is the problem): enter image description here

Chrome screenshot (this is how the divs should be rendering): enter image description here

question from:https://stackoverflow.com/questions/65943931/force-div-to-expand-with-content

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
101 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...