text-align justify not working

后端 未结 10 1823
名媛妹妹
名媛妹妹 2020-12-05 04:48

I\'m trying to justify the text within this p tag so that it perfectly fits the width of the p.

相关标签:
10条回答
  • 2020-12-05 05:10

    try this

    for div

    div {
    text-align:justify;
    text-justify: inter-word;
    text-align-last:center;
    /* for IE9 */
    -ms-text-align-last:center;
    }
    
    0 讨论(0)
  • 2020-12-05 05:11

    Chrome doesn't support it but in Firefox and IE, you can use text-align-last: justify;. For a cross-browser solution, we have to use what @onemanarmy posted ;)

    0 讨论(0)
  • 2020-12-05 05:13

    In my case for < p > tag, works with easy way:

    p {
      text-align: justify;
      text-justify: inter-word;
    }
    

    https://css-tricks.com/almanac/properties/t/text-justify/

    0 讨论(0)
  • 2020-12-05 05:15

    If you wanted to justify four words in 487px you could try using word-spacing in your css.

    I used word-spacing:8em; for bla bla bla bla but you could adjust as necessary.

    http://jsfiddle.net/5RpQr/1/

    0 讨论(0)
提交回复
热议问题