CSS3 Shadow Effects

  • text-shadow
  • box-shadow

1> text-shadow

  • The text-shadow property adds shadow to text.
  • This property accepts a comma-separated list of shadows to be applied to the text.

syntax

text-shadow: h-shadow v-shadow blur-radius color|none|initial|inherit;

Values

Value

Description

h-shadow Required. The position of the horizontal shadow. Negative values are allowed
v-shadow Required. The position of the vertical shadow. Negative values are allowed
blur-radius Optional. The blur radius. Default value is 0
color Optional. The color of the shadow. Look at CSS Color Values for a complete list of possible color values
none Default value. No shadow
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Example

 h2 {
text-shadow: 0 0 3px #FF0000;
}
h1 {
color: white;
text-shadow: 1px 1px 2px black, 0 0 25px blue, 0 0 5px darkblue;
}

2> box-shadow

  • The box-shadow property attaches one or more shadows to an element
box-shadow: none|h-shadow v-shadow blur spread color |inset|initial|inherit;

Values

Value Description
none Default value. No shadow is displayed
h-shadow Required. The position of the horizontal shadow. Negative values are allowed
v-shadow Required. The position of the vertical shadow. Negative values are allowed
blur Optional. The blur distance
spread Optional. The size of shadow. Negative values are allowed
color Optional. The color of the shadow. The default value is black.
inset Optional. Changes the shadow from an outer shadow (outset) to an inner shadow
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Example

 div {
box-shadow: 10px 10px 5px grey;
}

text-shadow demos

CSS3 Text

  • text-overflow
  • word-wrap
  • word-break

1> Text-overflow

text-overflow: clip|ellipsis|string|initial|inherit;

Values

Value Description
clip Default value. Clips the text
ellipsis Render an ellipsis ("...") to represent clipped text
string Render the given string to represent clipped text
initial Sets this property to its default value.
inherit Inherits this property from its parent element

2> word-wrap

  • The word-wrap property allows long words to be able to be broken and wrap onto the next line.

syntax

word-wrap: normal|break-word|initial|inherit;
Value Description
normal Break words only at allowed break points
break-word Allows unbreakable words to be broken

3> word-break

The word-break property specifies line breaking rules for non-CJK scripts.

syntax

word-break: normal|break-all|keep-all|initial|inherit;q
Value Description
normal Default value. Break words according to their usual rules
break-all Lines may break between any two letters
keep-all  Breaks are prohibited between pairs of letters

Web Fonts

  1. Web fonts allow Web designers to use fonts that are not installed on the user's computer.
  2. When you have found/bought the font you wish to use, just include the font file on your web server, and it will be automatically downloaded to the user when needed.
  3. Your "own" fonts are defined within the CSS3 @font-face rule.

Different Font Formats

1> TrueType Fonts (TTF)
2> OpenType Fonts (OTF)
3> The Web Open Font Format (WOFF)
4> The Web Open Font Format (WOFF 2.0)
5> SVG Fonts/Shapes
6> Embedded OpenType Fonts (EOT)

Example

 @font-face {
font-family: myFirstFont;
src: url(sansation_light.woff);
} div {
font-family: myFirstFont;
}

Tip: Always use lowercase letters for the font URL. Uppercase letters can give unexpected results in IE.

CSS3 笔记三(Shadow/Text/Web Fonts)的更多相关文章

  1. JSP学习笔记(三):简单的Tomcat Web服务器

    注意:每次对Tomcat配置文件进行修改后,必须重启Tomcat 在E盘的DATA文件夹中创建TomcatDemo文件夹,并将Tomcat安装路径下的webapps/ROOT中的WEB-INF文件夹复 ...

  2. 构建高性能WEB站点笔记三

    构建高性能WEB站点笔记三 第10章 分布式缓存 10.1数据库的前端缓存区 文件系统内核缓冲区,位于物理内存的内核地址空间,除了使用O_DIRECT标记打开的文件以外,所有对磁盘文件的读写操作都要经 ...

  3. JAVA WEB学习笔记(三):简单的基于Tomcat的Web页面

    注意:每次对Tomcat配置文件进行修改后,必须重启Tomcat 在E盘的DATA文件夹中创建TomcatDemo文件夹,并将Tomcat安装路径下的webapps/ROOT中的WEB-INF文件夹复 ...

  4. CSS3总结三:文字(text)/字体、文本、文本装饰、多列

    Text-Decoration text-shadow text-decoration Font font font-face Text 常用Text属性 Multi-column Multi-col ...

  5. Mastering Web Application Development with AngularJS 读书笔记(三)

    第一章笔记 (三) 一.Factories factory 方法是创建对象的另一种方式,与service相比更灵活,因为可以注册可任何任意对象创造功能.例如: myMod.factory('notif ...

  6. 学习笔记(三)--->《Java 8编程官方参考教程(第9版).pdf》:第十章到十二章学习笔记

    回到顶部 注:本文声明事项. 本博文整理者:刘军 本博文出自于: <Java8 编程官方参考教程>一书 声明:1:转载请标注出处.本文不得作为商业活动.若有违本之,则本人不负法律责任.违法 ...

  7. 《CMake实践》笔记三:构建静态库(.a) 与 动态库(.so) 及 如何使用外部共享库和头文件

    <CMake实践>笔记一:PROJECT/MESSAGE/ADD_EXECUTABLE <CMake实践>笔记二:INSTALL/CMAKE_INSTALL_PREFIX &l ...

  8. VSTO学习笔记(三) 开发Office 2010 64位COM加载项

    原文:VSTO学习笔记(三) 开发Office 2010 64位COM加载项 一.加载项简介 Office提供了多种用于扩展Office应用程序功能的模式,常见的有: 1.Office 自动化程序(A ...

  9. Django开发笔记三

    Django开发笔记一 Django开发笔记二 Django开发笔记三 Django开发笔记四 Django开发笔记五 Django开发笔记六 1.基于类的方式重写登录:views.py: from ...

随机推荐

  1. DS实验题 融合软泥怪-2 Heap实现

    题目和STL实现:DS实验题 融合软泥怪-1 用堆实现优先队列 引言和堆的介绍摘自:Priority Queue(Heaps)--优先队列(堆) 引言: 优先队列是一个至少能够提供插入(Insert) ...

  2. C# 的一些语法特性

    1.? -NullableC# 里像int,bool,double 这样的struct和enum类型都不能为null.如果确实想在值域上加上null的话,Nullable就派上用场了.T?是Nulla ...

  3. CentOS 创建SVN 服务器,并且自动同步到WEB 目录

    CentOS 创建SVN 服务器,并且自动同步到WEB 目录 标签: centossvnsubversion服务器 2013-12-06 10:09 5492人阅读 评论(0) 收藏 举报  分类: ...

  4. Unity内存理解(转)

    Unity3D 里有两种动态加载机制:一个是Resources.Load,另外一个通过AssetBundle,其实两者区别不大. Resources.Load就是从一个缺省打进程序包里的AssetBu ...

  5. hibernate学习(7)——HQL查询

    1.HQL查询定义 Hibernate查询分类: 1. get/load 根据OID检索 2. 对象视图检索 c.getOrders 3. Sql语句 createSqlQuery 4. Hql语句 ...

  6. python学习道路(day9note)(socketserver编程,ftp)

    1.ftp client #!/usr/bin/env python #_*_coding:utf-8_*_ import socket import subprocess user_data = { ...

  7. canvas简单图片处理(灰色处理)

    反色处理写的比较简单,灰色处理写了一些注释 <!DOCTYPE html> <html> <head> <meta charset="UTF-8&q ...

  8. sql执行

    一.提高sql执行效率---in与exist . where column in (select * from table where ...) . ...where exists (select ' ...

  9. VS2012完全卸载与VS2013安装

    项目本来使用的是vs2012 Ultimate,也一直跟随ms的节奏安装了从1到4的update,但一些无法忍受的问题却一直没有解决: 1.偶尔出现要等待编辑器响应的情况: 2.偶尔输入了冒号也不会出 ...

  10. 就publish/subscribe功能看redis集群模式下的队列技术(一)

    Redis 简介 Redis 是完全开源免费的,是一个高性能的key-value数据库. Redis 与其他 key - value 缓存产品有以下三个特点: Redis支持数据的持久化,可以将内存中 ...