如何使用CSS hanging-punctuation 属性设置字符标点的悬挂样式?

什么是CSS hanging-punctuation属性?


CSS hanging-punctuation属性用于设置字符标点的悬挂样式,通过该属性,我们可以控制标点符号是否悬挂在行首。

使用CSS hanging-punctuation属性的步骤

  1. 在CSS样式表中选择要应用悬挂样式的元素。
  2. 使用hanging-punctuation属性,并设置其值为想要的样式。

hanging-punctuation属性参数说明

参数 描述
none 默认值,标点符号不悬挂在行首。
first 标点符号悬挂在行首。
last 标点符号悬挂在行尾。
allow-end 标点符号悬挂在行尾,但只有在行尾没有更多内容时才悬挂。

代码案例

 p { hanging-punctuation: first; }

上述代码将使得段落中的标点符号悬挂在行首。

猿教程
请先登录后发表评论
  • 最新评论
  • 总共0条评论