I need to have a parent div, with a child div inside which contains nested text. the child div should only allow space for 2 lines of text, and any extra text should be cut off like in textOverflow=ellipsis, with "..." at the end. something like this:
Could you please tell me the most effective css and html for this? This is what i have come up with (which doesn't work):
outerContainer: {
padding: theme.spacing.unit * 0.5,
display: 'block',
maxHeight: "50px",
flexGrow: 1,
width: "100%",
overflow: 'hidden',
boxSizing: 'border-box',
},
innerContainer: {
padding: theme.spacing.unit * 0.5,
display: 'inline-block',
width: "100%",
height: 'auto',
boxSizing: 'border-box',
textOverflow: 'ellipsis',
wordBreak: 'break-all',
fontSize: "0.8rem",
fontFamily: theme.typography.fontFamily,
},
...
<div className={classes.outerContainer}>
<div className={classes.innerContainer}>
<span>{"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.</span>
</div>
</div>