📜  CSS | text-justify 属性

📅  最后修改于: 2021-08-30 09:33:27             🧑  作者: Mango

CSS 中的 text-justify 属性用于设置 text-align 为 justify。它将单词扩展为完整的行。

句法:

text-justify: auto|inter-word|inter-character|none:initial|inherit;

属性值:下面列出了文本对齐属性值:

  • auto:它用于允许浏览器确定哪个对齐属性更适合给定文本。

    句法:

    text-justify: auto;

    例子:

     
     
         
            text-justify property 
             
         
         
            

                GeeksforGeeks         

                         
                             

    text-justify: auto;

                                              
                 HTML stands for Hyper Text Markup Language.               It is used to design web pages using a markup              language. HTML is the combination of Hypertext              and Markup language.         
              
                              

    输出:

  • inter-word:通过增加或减少文本中单个单词之间的间距来调整文本。

    句法:

    text-justify: inter-word;

    例子:

     
     
         
            text-justify property 
             
         
         
            

                GeeksforGeeks         

                         
                             

    text-justify: inter-word;

                                              
                 HTML stands for Hyper Text Markup Language.               It is used to design web pages using a markup              language. HTML is the combination of Hypertext              and Markup language.         
              
                              

    输出:

  • inter-character:通过增加或减少文本中单个字符之间的间距来调整文本。

    句法:

    text-justify: inter-character;

    例子:

     
     
         
            text-justify property 
             
         
         
            

                GeeksforGeeks         

                         
                             

    text-justify: inter-character;

                                              
                 HTML stands for Hyper Text Markup Language.               It is used to design web pages using a markup              language. HTML is the combination of Hypertext              and Markup language.         
              
                              

    输出:

  • none:用于禁用文本中使用的对齐方法。

    句法:

    text-justify: auto;

    例子:

     
     
         
            text-justify property 
             
         
         
            

                GeeksforGeeks         

                         
                             

    text-justify: auto;

                                              
                 HTML stands for Hyper Text Markup Language.               It is used to design web pages using a markup              language. HTML is the combination of Hypertext              and Markup language.         
              
                              

    输出:

支持的浏览器: text-justify 属性支持的浏览器如下:

  • 谷歌浏览器
  • 浏览器 11.0
  • 火狐 55.0
  • 歌剧
  • Safari 10.0.3