I have 3 flex items here, but the width of 2nd item is larger than others, since the description of 2nd item is very long.
Is it possible to make all flex items to have equal height and width but not using fixed value of height and weight, when the content of description changes.
App.js
import "./styles.css";
export default function App() {
const containerStyles = {
display: "flex",
flexDirection: "column",
backgroundColor: "green",
marginRight: "10px",
flex: 1
};
return (
<div style={{ display: "flex" }}>
<div style={containerStyles}>
<div>Title 1</div>
<div>Description 1</div>
<div>Click to view detail</div>
</div>
<div style={containerStyles}>
<div>Title 2</div>
<div>Description 2 veryyyy longgggggggggggggggggggggg</div>
<div>Click to view detail</div>
</div>
<div style={containerStyles}>
<div>Title 3</div>
<div>Description 3</div>
<div>Click to view detail</div>
</div>
</div>
);
}
Codesandbox
https://codesandbox.io/s/crazy-cookies-nw0ykj