Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Material UI Typography underline

how can I make text with underlining without having enter or a new line?

   <Typography sx={{ 
          top: '104px',
          fontFamily: 'Roboto',
          fontStyle: 'normal',
          fontWeight: 'normal',
          lineHeight: '24px',
          fontSize: '16px',
          letterSpacing: '0.18px',
          color: '#172B4D',
          margin: '16px 0px'
       }}>
      The big brown fox jumps over the <Typography sx={{textDecoration: 'underline'}}>lazy </Typography> dog
      </Typography>

enter image description here


1 Answers

Just add display="inline"

<Typography sx={{ 
          top: '104px',
          fontFamily: 'Roboto',
          fontStyle: 'normal',
          fontWeight: 'normal',
          lineHeight: '24px',
          fontSize: '16px',
          letterSpacing: '0.18px',
          color: '#172B4D',
          margin: '16px 0px'
       }}>
      The big brown fox jumps over the <Typography sx={{textDecoration: 'underline'}} display="inline">lazy </Typography> dog
      </Typography>
like image 142
Roger Avatar answered Aug 08 '26 21:08

Roger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!