`
semi_sleep
  • 浏览: 99023 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

读XML in a Nutshell (9)

    博客分类:
  • XML
阅读更多

本篇包括Chapter 12 Cascading Style Sheets。

1.Css文件由若干段组成,每一段代表着将某种格式套用到某类element上面,由selector和properties构成。Css通过在properties中定义name value pair来指定显示的格式,name跟value都是不区分大小写的。父节点的格式将自动套用到其子孙节点上。Css是不管namespace的存在的,所以如果要选择某个namespace下面的element,则需加上与该element所用的namespace prefix相同的prefix。采用xml-stylesheet的指令可以将某个css应用到当前xml文档上,这一指令包含的type,href,charset,title,media,alternate这几个属性,例子如下:
step {font-family: Palatino, serif; font-size: 10pt }

<?xml-stylesheet type="text/css" href="recipe.css"?>

2.Selector,*代表所有的element,A B代表所有是A的子孙节点的B,A > B代表所有是A的子节点的B,A + B代表所有是A相邻节点的B。可以采用attribute selector来选择具有某些特定attribute的element,A[B]表示所有具有B属性的A,A[B="xxx"]表示所有具有B属性,并且属性值为xxx的A,在上面的表达中,除了使用=,使用~=表示在由token构成的字符串中包含某个token,使用|=表示在由连接符构成的单词中包含以某个token开头。最后使用element#xxx的方式选择某类element中id为xxx的element。

3.Preudo selector,通过element:xxx的方式定义,其中xxx有以下类型first-child,link,visited,active,hover,focus,lang,first-letter,first-line,before,after。其中before跟after套用格式没有意义,看是可以通过content这个property插入内容。

4.Display这个property,inline是默认设置,block就是在这个element前后分行,list-item就是作为一个list显示,none就是不显示,table则是作为表格显示(具体要查书了)。

5.在各种长度单位中em是指相对于M这个字符的长度,ex是指相对于x这个字符的高度。

6.之外还包括font,text,color等等的properties,这些就慢慢查吧。

分享到:
评论

相关推荐

    XML.in.a.Nutshell

    XML.in.a.Nutshell(英文版)

    C# 5.0 in a Nutshell 5th

    C# 5.0 in a Nutshell 5th

    R in a Nutshell

    R in a Nutshell, pdf version

    Python in a Nutshell Third Edition 2017

    Python in a Nutshell 2017 最新版

    C# 5.0 in a Nutshell, 5th Edition

    C# 5.0 in a Nutshell, 5th Edition 是英文的,别搞错了。

    Linux Kernel in a Nutshell

    Linux Kernel in a Nutshell Linux Kernel in a Nutshell

    Delphi in a Nutshell

    Delphi in a Nutshell is the first concise reference to Borland/Inprise Delphi available. It succinctly collects all the information you need in one easy-to-use, complete, and accurate volume that goes...

    USB in a Nutshell

    Starting out new with USB can be quite daunting. With the USB 2.0 specification at 650 pages one could easily be put off just by the sheer size of... None of these are detailed in the USB 2.0 Spec.

    Ruby In a Nutshell

    Ruby In a Nutshell

    C# 5.0 7.0 in a Nutshell EN

    C# 7.0 in a Nutshell EN,C# 5.0 in a Nutshell EN,英文原版PDF

    Java in a Nutshell(中文版)

    Java in a Nutshell(6th) 英文无水印pdf 第6版 pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    C# in a nutshell

    Get up to speed on C# language basics, including ...Learn .NET topics, including XML, collections, I/O and networking, memory management, reflection, attributes, security, and native interoperability

    C# 6.0 in a Nutshell(6th) 无水印pdf

    C# 6.0 in a Nutshell(6th) 英文无水印pdf 第6版 pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系...

    C# 6.0 in a Nutshell.pdf

    Dive in and discover why this Nutshell guide is considered the definitive reference on C#. Get up to speed with all aspects of the C# language, from the basics of syntax and variables, to advanced ...

    C# 7.0 in A Nutshell

    Dive in and discover why this Nutshell guide is considered the definitive reference on C#. Get up to speed on the C# language, from the basics of syntax and variables to advanced topics such as ...

    SQL in a Nutshell

    SQL in a Nutshell讲述sql的基础知识,可能对大家有帮助。

    C# 4.0 in a Nutshell

    C# 4.0 in a Nutshell

Global site tag (gtag.js) - Google Analytics