文字阴影

text-shadow: 水平偏移 垂直偏移 模糊 颜色

兼容性:IE10+

Document

p{

color:blue;

text-shadow: 3px 3px 3px black;

}

这是一段测试文本鸭

css3 换行

word-break: normal | break-all | keep-all

对于英文文本:normal 和 keep-all 效果相同;break-all 即字母和字母见换行,不考虑单词的影响

对于中文文本:normal 和 break-all 效果相同;keep-all 即根据标点符号换行

Document

p{width:500px;}

span{background:#abcdef;}

p:nth-child(1){word-break:normal;}

p:nth-child(2){word-break:break-all;}

p:nth-child(3){word-break:keep-all;}

p:nth-child(5){word-break:normal;}

p:nth-child(6){word-break:break-all;}

p:nth-child(7){word-break:keep-all;}

[word-break:normal] I have a dream that one day on the red hills of Georgia, the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood.

[word-break:break-all] I have a dream that one day on the red hills of Georgia, the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood.

[word-break:keep-all] I have a dream that one day on the red hills of Georgia, the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood.


[word-break:normal] 我梦想有一天,这个国家会站立起来,真正实现其信条的真谛:“我们认为人人生而平等的真理不言而喻。”我梦想有一天,在佐治亚的红山上,从前奴隶的后嗣将能够和奴隶主的后嗣坐在一起,共叙兄弟情谊。

[word-break:break-all] 我梦想有一天,这个国家会站立起来,真正实现其信条的真谛:“我们认为人人生而平等的真理不言而喻。”我梦想有一天,在佐治亚的红山上,从前奴隶的后嗣将能够和奴隶主的后嗣坐在一起,共叙兄弟情谊。.

[word-break:keep-all] 我梦想有一天,这个国家会站立起来,真正实现其信条的真谛:“我们认为人人生而平等的真理不言而喻。”我梦想有一天,在佐治亚的红山上,从前奴隶的后嗣将能够和奴隶主的后嗣坐在一起,共叙兄弟情谊。

word-wrap 针对连续的英文长单词或者url网址(中文无效)

word-wrap:normal | break-word;

Document

p{width:200px;}

span{background:#abcdef;}

p:nth-child(1){word-wrap:normal;}

p:nth-child(2){word-wrap:break-word;}

[word-wrap:normal]
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

[word-wrap:break-word]
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

text-align-last 文本最后一行如何对齐

只有IE支持,火狐需要加-moz-前缀,谷歌50+支持

Document

p{width:800px;}

span{background:#abcdef;}

p:nth-child(1){text-align-last:auto;}

p:nth-child(2){text-align-last:left;}

p:nth-child(3){text-align-last:right;}

p:nth-child(4){text-align-last:center;}

p:nth-child(5){text-align-last:justify;}

p:nth-child(6){text-align-last:start;}

p:nth-child(7){text-align-last:right;}

p:nth-child(8){text-align-last:initial;}

p:nth-child(9){text-align-last:inherit;}

autoHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

leftHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

rightHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

centerHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

justifyHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

startHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

endHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

initialHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

inheritHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

text-align-last 只在text-align:justify 时才有效

text-overflow

使用时需要设置元素为overflow:hidden;

中文无效,英文短单词无效,只对英文长单词有效

Document

div{width:800px;overflow:hidden;}

span{background:#abcdef;}

div:nth-child(1){text-overflow:clip;}

div:nth-child(2){text-overflow:ellipsis;}

div:nth-child(3){text-overflow:">>";}

div:nth-child(4){text-overflow:clip;}

div:nth-child(5){text-overflow:ellipsis;}

div:nth-child(6){text-overflow:">>";}

div:nth-child(7){text-overflow:clip;}

div:nth-child(8){text-overflow:ellipsis;}

div:nth-child(9){text-overflow:">>";}

clipHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。
ellipsisHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。
stringHTML称为超文本标记语言,是一种标识性的语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。
clipI have a dream that one day on the red hills of Georgia, the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood.
ellipsisI have a dream that one day on the red hills of Georgia, the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood.
stringI have a dream that one day on the red hills of Georgia, the sons of former slaves and the sons of former slave owners will be able to sit down together at the table of brotherhood.
clipaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ellipsisaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
stringaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

text-overflow:clip; 隐藏

text-overflow:ellipsis; 省略号

text-overflow:string; 指定字符,只在火狐浏览器有效

Document

div{width:800px;overflow:hidden;}

span{background:#abcdef;}

div:nth-child(1){text-overflow:clip;}

div:nth-child(2){text-overflow:ellipsis;}

div:nth-child(3){text-overflow:">>";}

div:nth-child(4){text-overflow:clip;}

div:nth-child(5){text-overflow:ellipsis;}

div:nth-child(6){text-overflow:">>";}

div:nth-child(7){text-overflow:clip;}

div:nth-child(8){text-overflow:ellipsis;}

div:nth-child(9){text-overflow:">>";}

clipaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ellipsisaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
stringaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

overflow: visible | hidden | scroll | auto | inherit

鼠标悬浮时显示隐藏的文字

Document

div{width:800px;overflow:hidden;text-overflow:ellipsis;}

div:hover{overflow:visible;}

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

@font-face 兼容性 IE9+

字体格式

TrueType .ttf 无优化 兼容性IE9+

OpenType .otf 是ttf的升级版,不兼容IE

.woff web版本最佳字体格式 是TrueType/OpenType的压缩格式 兼容性IE9+ 但是不能兼容手机端!

.eot IE专用字体格式

.svg svg字体格式 IE和火狐都不兼容

自定义字体通用模板

Document

@font-face{

font-family:"myFont";

src:url('font/myFont.eot'),/*兼容IE9+*/

url('font/myFont.eot?#iefix') format('embedded-opentype'),/*兼容IE6-8*/

url('font/myFont.ttf') format('truetype'),/*兼容手机端*/

url('font/myFont.woff') format('woff'),/*兼容所有浏览器*/

url('font/myFont.svg#myFont') format('svg');/*针对ios开发*/

}

p{font-family: 'myFont';}

这是我的自定义字体呀~

由于是国外服务器,因此下载速度比较慢

注意:经我个人发现,这个软件转换出来的字体格式,都只支持英文版

建议还是使用其他国内的在线转换工具或者网址

字体文件

Document

@font-face {

font-family: '杨任东竹石体';

src:url('myfont/杨任东竹石体.eot'),/*兼容IE9+*/

url('myfont/杨任东竹石体.eot?#iefix') format('embedded-opentype'),/*兼容IE6-8*/

url('myfont/杨任东竹石体.ttf') format('truetype'),/*兼容手机端*/

url('myfont/杨任东竹石体.woff') format('woff'),/*兼容所有浏览器*/

url('myfont/杨任东竹石体.svg#杨任东竹石体') format('svg');/*针对ios开发*/

}

p{font-family: '杨任东竹石体';font-size:24px;}

HELLO THIS IS MY FONT~这是我的自定义字体~

成功~~~

总结

以上所述是小编给大家介绍的CSS3中新增的对文本和字体的设置,希望对大家有所帮助!

html给字体增加小手,CSS3中新增的对文本和字体的设置相关推荐

  1. 微信小程序font-family中提供的十四种字体

    微信小程序font-family中提供的十四种字体 链接:https://blog.csdn.net/include_IT_dog/article/details/98382276

  2. 详解CSS3中新增的内容属性:content

    详解CSS3中新增的内容属性:content 1. 用法: content属性用于插入生成的内容,常和:before选择器和:after选择器配合使用,将生成的内容放在一个元素内容的前面或后面. 2. ...

  3. 关于——css3新增属性有哪些?css3中新增属性(部分总结)

    css3中新增属性(部分总结) 一.css3新增边框属性 border-color:为边框设置多种颜色 border-image:属性是使用图片来创建边框 border-radius:圆角边框 box ...

  4. css3中斜杠_使用斜杠语法设置CSS3边界半径

    css3中斜杠 What could I possibly say about the CSS3 border-radius property that hasn't been said before ...

  5. html 中加小手,html中鼠标如何设置显示小手状?

    材料/工具:css 1.打开前端开发软件,新建一个html代码页面 2.在新建的html代码页面上找到 ,在这个标签里创建一个标签,a案例中使用的是. 代码: 大家好,鼠标放到我身上就可看到效果 3. ...

  6. linux怎么把中文换成英文字体,怎么配置fontconfig让中文和英文选择不同的字体呢?...

    [quote:600ec1b9cc="songzw"]我原来把下面内容放在 local.conf 里,不行,原来必须放在 fonts.conf 中, 有个读取顺序问题 [code: ...

  7. CSS3中引入多种自定义字体(font-face)

    今天在HTML中发现了一个问题,提供给我们默认的字体有很多,但是除了那些"黑体"."宋体"."楷体"等支持中文字体之外,其余的都不知道中文字 ...

  8. 记录:给ant+vue table的表头增加点击事件与不同颜色和小手图标。

    在table表的列lolumns里面添加customHeaderCell:column =>{return {style: {// 行背景色'background-color': '#8fd0f ...

  9. css3中变形与动画(三)

    transform可以实现矩阵变换,transition实现属性的平滑过渡,animation意思是动画,动漫,这个属性才和真正意义的一帧一帧的动画相关.本文就介绍animation属性. anima ...

最新文章

  1. 不甘心只做输入工具,搜狗输入法上线AI助手,提供智能服务
  2. Day03——Python函数
  3. 自考之——我看《软件开发工具》
  4. MSSQL - 通用存储过程
  5. inux系统中如何进入退出vim编辑器
  6. 【Eclipse】eclipse中设置tomcat启动时候的JVM参数
  7. python通用数据库连接_python-sqlalchemy 使用学习记录之基础连接数据库安装接篇...
  8. Linux离线安装rzsz
  9. 使用DCMTK实现DICOM文件浏览器dicom explorer
  10. 黑盒测试和白盒测试详解
  11. YouTube上的版权保护
  12. 如何在python中获得当前时间前几天的日期
  13. 为什么技术开发者应该读一读《浪潮之巅》
  14. 出生日期与年龄python_python根据出生日期返回年龄的方法
  15. K8S故障排查指南:部分节点无法启动Pod资源-Pod处于ContainerCreating状态
  16. C盘不够了怎么办!将其他盘空间怎么分给C盘!
  17. 代码阅读方法(自己总结地 厚厚)
  18. 阿里巴巴内测全网社交产品来往
  19. Howler 音频资源跨域提示html5
  20. 802.11ac路由选购技术攻略

热门文章

  1. 全球最强路由来袭, 华硕再发三款AX电竞新品
  2. 1N4148WS-E3-08你不得不知道的二三事
  3. 优大麦自动接单软件助手神器
  4. PHP和HTML混合编写
  5. 生活不止眼前的苟且,还有诗和远方
  6. 【Vue组件详解(一)】
  7. Improved Disease Classification in Chest X-Rays with Transferred Features from Report Generation论文解读
  8. YII中You are not authorized to perform this action的解决方法
  9. 自定义注解利用反射记录日志
  10. JAVA基础类库(第四周)(三只松鼠,奥利给)