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. Linux下安装搭建WordPress网站

    WordPress简介 WordPress 是一种使用 PHP语言和 MySQL数据库开发的开源.免费的Blog(博客,网志)引擎,用户可以在支持 PHP 和 MySQL 数据库的服务器上建立自己的 ...

  2. win7与virtualbox中centos文件共享

    1.首先在Windows下创建一个文件夹,用于存放共享的文件,例如 E:\share 2.将该文件夹设置为共享文件夹. 右击文件夹,选择共享->特定用户 选择Everyone->添加-&g ...

  3. ASP.NET Web API 2基于令牌的身份验证

    基于令牌的认证 我们知道WEB网站的身份验证一般通过session或者cookie完成的,登录成功后客户端发送的任何请求都带上cookie,服务端根据客户端发送来的cookie来识别用户. WEB A ...

  4. SET QUOTED_IDENTIFIER ON和SET ANSI_NULLS ON

    distinct是sqlserver的标识符,如果想以distinct为表时,在QUOTED_IDENTIFIER为off的情况下,是不能创建表名为distinct的表的,因为在QUOTED_IDEN ...

  5. 7. ensemble learning & AdaBoost

    1. ensemble learning 集成学习 集成学习是通过构建并结合多个学习器来完成学习任务,如下图: 集成学习通过将多个学习学习器进行结合,常可以获得比单一学习器更优秀的泛化性能 从理论上来 ...

  6. wp8.1 VS2013部署手机发生 DEP6100 6200错误

    wp8.1 VS2013部署手机发生 DEP6100 6200错误 ,提示未发现手机. 可能是数据线有问题 建议更换 本人的电脑有很多次,提示DEP6100 6200错误,每一次都需要重做系统.. 然 ...

  7. 高级java必会系列一:多线程的简单使用

    众所周知,开启线程2种方法:第一是实现Runable接口,第二继承Thread类.(当然内部类也算...)常用的,这里就不再赘述.本章主要分析总结线程池和常用调度类. 一.线程池 1.newCache ...

  8. tomcat由浅入深

    零.服务器.Servlet容器.web容器 Servlet容器:能够运行Servlet的环境叫做Servlet容器 web容器:能够运行web应用的环境就叫做web容器 weblogic websph ...

  9. UNDER THE HOOD OF THE NEW AZURE PORTAL

    http://jbeckwith.com/2014/09/20/how-the-azure-portal-works/ So - I haven’t been doing much blogging ...

  10. 调试一个socket通信bug的心理过程和反思

    背景交代.最近在玩lua的服务端编码, 有项目A,B,AB都是同一个模子的.我手上有A的winsocket客户端和服务端的代码,B项目早期的一份linux下的lua client.服务端.客户端都是L ...