📜  CSS |挂标点属性

📅  最后修改于: 2021-08-31 06:28:18             🧑  作者: Mango

CSS 中的悬挂标点属性为网页设计师提供了一些优于网页排版的优势。 hang-punctuation 属性指定标点符号是放在行框外的某行文本的开头还是结尾。

基本上,它为网页设计人员提供了将项目符号或任何符号设置为特定的左对齐或右对齐,以便第一个字母与文档的其余部分正确对齐。

我们可以将以下关键字与 hang-punctuation 属性一起使用,并且可以在不同的模式或类型中使用:

  • 关键字值
  • 两个关键字值
  • 三个关键字值
  • 全局关键字值
  • 语法:对于关键字值
    ohanging-punctuation: none;
    hanging-punctuation: first;
    hanging-punctuation: last;
    hanging-punctuation: force-end;
    hanging-punctuation: allow-end;
    
  • 语法:对于两个关键字值
    hanging-punctuation: first force-end;
    hanging-punctuation: first allow-end;
    hanging-punctuation: first last;
    hanging-punctuation: last force-end;
    hanging-punctuation: last allow-end;
    
  • 语法:对于三个关键字值
    hanging-punctuation: first force-end last;
    hanging-punctuation: first allow-end last;
    
  • 语法:对于全局值
    hanging-punctuation: inherit;
    hanging-punctuation: initial;
    hanging-punctuation: unset;
    

属性值:

Keyword Functionality
none This is the default value for this property. No character hangs.
first Using an available character at the start of the first formatted line of an element hangs.
last An available character at the end of the last formatted line of an element hangs.
force-end Using stop or comma at the end of a line hangs.
allow-end A stop or comma at the end of a line hangs if it does not otherwise fit prior to justification.

例子:



    
        
            CSS Hanging Punctuation Property
        
        
    
      
    
        

“GeeksforGeeks: A computer science portal”

    

输出 :

浏览器: hanging-punctuation 属性支持的浏览器如下:

  • Safari 10.0+