How does text-align achieve alignment at both ends (compatible with IOS version)

text-align-last: Justify can realize text alignment at both ends (not compatible with IOS), see the following figure for details:

insert image description here

Realize the alignment of both ends of the IOS text: the realization principle is: use a pseudo-class to make the element not the last line

     .label_name {
    
    
        min-width: 140rpx;
        text-align: justify;
        display: inline-block;
        text-align-last: justify;
        vertical-align: top;
        &:after {
    
    
          display: inline-block;
          content: '';
          overflow: hidden;
          width: 100%;
          height: 0;
        }
      }

Guess you like

Origin blog.csdn.net/qq_44094296/article/details/124131489