CSS 中的 text-justify 属性
cssweb developmentfront end technology更新于 2024/11/5 3:56:17
CSS 中的 text-justify 属性用于在 text-align 属性设置为 justify 值时设置文本的对齐方式。以下是属性值减去
text-justify: auto|inter-word|inter-character|none|initial|inherit;
示例
现在让我们看一个在 CSS 中实现 text-justify 属性的示例 −
<!DOCTYPE html>
<html>
<head>
<style>
div {
text-align: justify;
text-justify: inter-word;
color: white;
background-color: gray;
}
</style>
</head>
<body>
<h2>Demo Heading</h2>
<div>This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. </div>
</body>
</html>
输出

现在,调整浏览器大小 −

相关文章
有用资源
css 参考教程 - 该教程包含有关 css 的更多信息:https://www.cainiaomax.com/css/

