当前位置: 首页 > news >正文

CSS文本属性与字体

一,文本属性 

  • text-decoration

  • text-transform

  • text-indent

  • text-align

  • word/letter-spacing

text-decoration

text-decoration取值为:

  • none:去除所有装饰
  • underline:添加下划线
  • overline:添加上划线
  • line-through:添加中划线

text-transform

text-transform取值为:

  • capitalize:把每个单词的首字符变为大写
  • uppercase:把每个单词的所有字符变为大写
  • lowercase:把每个单词的所有字符变为小写
  • none:无影响

text-indent

 text-indent 为第一行的缩进大小。

text-indent:2em;

text-align

 text-align取值为:

  • left:左对齐
  • right:右对齐
  • center:居中对齐
  • justify:两端对齐

!text-align只适用于行内元素

text-align:center与text-align:justify的区别:

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title>
</head>
<style>div {height: 200px;width: 30%;background-color: azure;text-align: center;}
</style><body><div>Welcome to Flask’s documentation.Get started with Installation and then get an overview with the Quickstart.There is also a more detailed Tutorial that shows how to create a small but complete application with Flask.Common patterns are described in the Patterns for Flask section.The rest of the docs describe each component of Flask in detail, with afull reference in the API section.</div></body></html>

 

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title>
</head>
<style>div {height: 200px;width: 30%;background-color: azure;text-align: justify;}
</style><body><div>Welcome to Flask’s documentation.Get started with Installation and then get an overview with the Quickstart.There is also a more detailed Tutorial that shows how to create a small but complete application with Flask.Common patterns are described in the Patterns for Flask section.The rest of the docs describe each component of Flask in detail, with afull reference in the API section.</div></body></html>

 

letter-spacing

letter-spacing可以控制字间距,可以为负数。

二,字体属性

  • font-size
  • font-family
  • font-weight
  • line-height
  • font-style
  • font-variant

font-size

数值+单位

font-size:10px;
font-size:2em;

百分比(相对于父级元素的大小

font-size:50%;

font-family

字体类型设置

font-weight

字体大小设置

取值:

100/200/300.....,每个数字表示一个重量

normal = 400

bold = 700

 

line-height

行高为基线之间的距离:

 

font-style

font-style取值:

  • normal:常规显示
  • italic:斜体形式
  • oblique:倾斜

font-variant

normal:常规显示

small-caps:将小写字母替换为缩小过的大写字母

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 秋招力扣Hot100刷题总结——堆
  • Java和C#哪个更适合大型项目?
  • 17 深入理解 C 语言 main 函数:返回值意义、命令行参数接收、跨环境差异及CMD乱码解决
  • anaconda的power shell和prompt有什么区别?
  • 【TCP】核心机制:滑动窗口、流量控制和拥塞控制
  • ubuntu install Miniconda3(轻量级conda)
  • Using Azure openAI key rotation automation
  • 大数据毕业设计开题报告100例
  • Kafka快速入门:Kafka驱动JavaApi的使用
  • docker容器数据卷、数据卷基本案例
  • WebSocket、Socket和Netty的关系
  • Ubuntu下torch.cuda.is_available() 返回 False情况
  • 2-75 基于matlab的多尺度小波核svm预测
  • 谷歌浏览器 Google Chrome 禁止扩展.crx更新
  • 二叉树【2.5】代码专项
  • hexo+github搭建个人博客
  • 【402天】跃迁之路——程序员高效学习方法论探索系列(实验阶段159-2018.03.14)...
  • HashMap剖析之内部结构
  • iOS动画编程-View动画[ 1 ] 基础View动画
  • iOS小技巧之UIImagePickerController实现头像选择
  • java2019面试题北京
  • JavaScript HTML DOM
  • JS创建对象模式及其对象原型链探究(一):Object模式
  • JS基础之数据类型、对象、原型、原型链、继承
  • js如何打印object对象
  • V4L2视频输入框架概述
  • 百度地图API标注+时间轴组件
  • 第十八天-企业应用架构模式-基本模式
  • 复习Javascript专题(四):js中的深浅拷贝
  • 构造函数(constructor)与原型链(prototype)关系
  • 函数式编程与面向对象编程[4]:Scala的类型关联Type Alias
  • 极限编程 (Extreme Programming) - 发布计划 (Release Planning)
  • 经典排序算法及其 Java 实现
  • 前端学习笔记之观察者模式
  • 实战|智能家居行业移动应用性能分析
  • 云大使推广中的常见热门问题
  • 蚂蚁金服CTO程立:真正的技术革命才刚刚开始
  • ​Redis 实现计数器和限速器的
  • #define与typedef区别
  • #在 README.md 中生成项目目录结构
  • #周末课堂# 【Linux + JVM + Mysql高级性能优化班】(火热报名中~~~)
  • (16)Reactor的测试——响应式Spring的道法术器
  • (arch)linux 转换文件编码格式
  • (Redis使用系列) Springboot 整合Redisson 实现分布式锁 七
  • (web自动化测试+python)1
  • (八)Flask之app.route装饰器函数的参数
  • (编程语言界的丐帮 C#).NET MD5 HASH 哈希 加密 与JAVA 互通
  • (博弈 sg入门)kiki's game -- hdu -- 2147
  • (第61天)多租户架构(CDB/PDB)
  • (第8天)保姆级 PL/SQL Developer 安装与配置
  • (二)hibernate配置管理
  • (九)One-Wire总线-DS18B20
  • (四)搭建容器云管理平台笔记—安装ETCD(不使用证书)
  • (五)Python 垃圾回收机制
  • (一)基于IDEA的JAVA基础12