CSS的文本属性

text-align属性

指定文本的水平对齐方式

left: 文本居左对齐(默认值)

right: 居右对齐

center:居中对齐

css 复制代码
   .p1{
            text-align: left;
        }
        .p2{
            text-align: right;
        }
        .p3{
            text-align: center;
        }

text-decorration属性

规定添加到文本的修饰,下划线,上划线,删除线等。

underline:下划线

overline: 上划线

line-through: 删除线

css 复制代码
 .p1{
            text-align: left;
            text-decoration: underline;
        }
        .p2{
            text-decoration: overline;
            text-align: right;
        }
        .p3{
            text-decoration: line-through;
            text-align: center;
        }

text-transtorm属性

规定文本的下小写。

captialize: 定义每个单词开头大写

uppercase: 定义全部大写

lowercase: 定义全部小写

html 复制代码
​
  <p class="p1">define how each word starts with a capital case</p>
    <p class="p2">define all caps</p>
    <p class="p3">DEFINE ALL LOOWERCASE</p>
​
css 复制代码
  .p1{
        text-transform: capitalize;
        }
        .p2{
            text-transform: uppercase;
        }
        .p3{
            text-transform: lowercase;
        }
    </styl
css 复制代码
  .p1{
        text-transform: capitalize;
        }
        .p2{
            text-transform: uppercase;
        }
        .p3{
            text-transform: lowercase;
        }
   

text-indent属性

规定文本块中首航文本的缩进(单位px)

css 复制代码
 p{
            text-indent: 30px;
        }
相关推荐
用户0595401744639 分钟前
把多级缓存一致性验证从手工测试换成 Pytest 参数化,Bug 排查时间缩短 90%
前端·css
用户059540174461 小时前
把 Redis 持久化测试从 800 行 Shell 换成 30 行 pytest,排错效率翻了 10 倍
前端·css
W.A委员会1 小时前
多行溢出在末尾添加省略号
开发语言·javascript·css
ZC跨境爬虫4 小时前
跟着 MDN 学 HTML day_8:(高级文本语义标签+适配核心功底)
前端·css·笔记·ui·html
里欧跑得慢16 小时前
17. Flutter Hero动画实现:让界面过渡更加优雅
前端·css·flutter·web
凯瑟琳.奥古斯特20 小时前
Redis是什么及核心特性
前端·css·redis·缓存
DFT计算杂谈20 小时前
VASP官方教程 TRIQS DFT+DMFT计算教程
运维·css·自动化·html·css3
可达鸭小栈1 天前
易语言实现CSS像素文字生成器:无需字体文件渲染汉字
前端·css
yqcoder1 天前
CSS 迷思破解:`:nth-child` vs `:nth-of-type`
前端·css
遇见~未来1 天前
第六篇_CSS进阶_深入浏览器与工程化
前端·css·rust