- 浏览: 35864 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
shenbai:
thanks。我试了一下,实际上只需要调用waitForBac ...
HTMLUnit : javascript 对页面的更改如何获得
11. 为段落文本加高亮
12. 设置段落行高
使用line-height属性。
13. pg42 使段落四周空白均匀
设置text-align属性为justify。可设值包括:right, left, center。
14. 为hr标签(水平分隔线)加样式
水平分隔线可以设置属性,如边框,背景颜色,颜色,高度,宽度等。
15. 段落缩进
为左边paddingpadding-left指定一个值,如本例指定了20像素。
16. 用CSS设置段落文本全部为大写
设置段落的text-transform属性为uppercase即可。可选值还有:capitalize, lowercase, none(这是默认值)。
17. 改变列表风格或者去除列表项前置图标
可以设置列表风格类型,如square,前置图标为小方块。还有disc, circle, decimal-leading-zero, decimal, lower-roman, upper-roman, lower-greek, lower-alpha, lower-latin, upper-alpha, upper-latin, Hebrew, Armenian, Georgian, none等等。
18. 使用图片作为列表项的前置图标
指定一张图片给列表风格图像list-style-image作为值。
19. 移除列表项的左边留白(即移除左边的缩进)
把列表风格类型(指前置图标)设置为none,再把左边的margin和padding设置为0值。
20. 把列表项显示到同一个水平方向上
设置display属性值为inline可以把列表项都显示到水平方向上。
(第二章 · 完)
<div> <h1 class="pg39"> Chinese-style Stuffed Peppers </h1> Below, I've created a CSS rule for all te level-one headings in a document. The result is shown in Figure 2.11. hello, world...... </div> <div class="pg39"> <h1 class="pg39"> Chinese-style Stuffed Peppers </h1> <p> These <span class="pg39_highlight">stuffed peppers</span> are lovely as a starter, or as a side sish for a Chinese meal. They also go down well as part of a buffet, and even children seem to like them. </p> </div>
/* 设置文本高亮 */ .pg39_highlight { background-color : #FFFFCC; color : #B22222; }
图2-6
12. 设置段落行高
使用line-height属性。
<div class="pg40"> <p class="pg40"> Once upon a time, a mouse, a bird, and a sausage entered into partnership and set up house together. For a long time all went well; they lived in great comfort, and prospered so far as to be able to add considerably to their stores. The bird's duty was to fly daily into the wood and bring in fuel, the mouse fetched the water, and the sausage saw to the cooking. </p> </div>
p.pg40 { font : 0.9em Verdana, Geneva, Arial, Helvetica, sans-serif; /* 设置行高,2.0是比率值,指比缺省设置大两倍。 */ line-height : 2.0; }
图2-7
13. pg42 使段落四周空白均匀
设置text-align属性为justify。可设值包括:right, left, center。
<div class="pg42"> <p class="pg42"> Once upon a time, a mouse, a bird, and a sausage entered into partnership and set up house together. For a long time all went well; they lived in great comfort, and prospered so far as to be able to add considerably to their stores. The bird's duty was to fly daily into the wood and bring in fuel, the mouse fetched the water, and the sausage saw to the cooking. </p> </div>
p.pg42 { /* 设置文本自动调节——左右两边空白均匀 */ text-align : justify; /* 可设值包括:right, left, center */ font : 1em Verdana, Geneva, Arial, Helvetica, sans-serif; line-height : 2.0; }
图2-8
14. 为hr标签(水平分隔线)加样式
水平分隔线可以设置属性,如边框,背景颜色,颜色,高度,宽度等。
<div class="pg43"> <p> Once upon a time, a mouse, a bird, and a sausage entered into partnership and set up house together. For a long time all went well; they lived in great comfort, and prospered so far as to be able to add considerably to their stores. The bird's duty was to fly daily into the wood and bring in fuel, the mouse fetched the water, and the sausage saw to the cooking. </p> <hr class="pg43"/> <p> Once upon a time, a mouse, a bird, and a sausage entered into partnership and set up house together. For a long time all went well; they lived in great comfort, and prospered so far as to be able to add considerably to their stores. The bird's duty was to fly daily into the wood and bring in fuel, the mouse fetched the water, and the sausage saw to the cooking. </p> </div>
hr.pg43 { border : none; background-color : #ADD8E6; color : #ADD8E6; height : 1px; width : 80%; }
图2-9
15. 段落缩进
为左边paddingpadding-left指定一个值,如本例指定了20像素。
<div class="pg45"> <p> Once upon a time, a mouse, a bird, and a sausage entered into partnership and set up house together. For a long time all went well; they lived in great comfort, and prospered so far as to be able to add considerably to their stores. The bird's duty was to fly daily into the wood and bring in fuel, the mouse fetched the water, and the sausage saw to the cooking. </p> <hr/> <p class="pg45indent"> Once upon a time, a mouse, a bird, and a sausage entered into partnership and set up house together. For a long time all went well; they lived in great comfort, and prospered so far as to be able to add considerably to their stores. The bird's duty was to fly daily into the wood and bring in fuel, the mouse fetched the water, and the sausage saw to the cooking. </p> </div>
p.pg45indent { padding-left : 30px; }
图2-10
16. 用CSS设置段落文本全部为大写
设置段落的text-transform属性为uppercase即可。可选值还有:capitalize, lowercase, none(这是默认值)。
<div class="pg47"> <p> Once upon a time, a mouse, a bird, and a sausage entered into partnership and set up house together. For a long time all went well; they lived in great comfort, and prospered so far as to be able to add considerably to their stores. The bird's duty was to fly daily into the wood and bring in fuel, the mouse fetched the water, and the sausage saw to the cooking. </p> <hr/> <p class="pg48transform"> Once upon a time, a mouse, a bird, and a sausage entered into partnership and set up house together. For a long time all went well; they lived in great comfort, and prospered so far as to be able to add considerably to their stores. The bird's duty was to fly daily into the wood and bring in fuel, the mouse fetched the water, and the sausage saw to the cooking. </p> </div>
p.pg48transform { text-transform : uppercase; /* capitalize, lowercase, none(the default) */ }
图2-11
17. 改变列表风格或者去除列表项前置图标
可以设置列表风格类型,如square,前置图标为小方块。还有disc, circle, decimal-leading-zero, decimal, lower-roman, upper-roman, lower-greek, lower-alpha, lower-latin, upper-alpha, upper-latin, Hebrew, Armenian, Georgian, none等等。
<div class="pg47"> <ul class="pg50"> <li>list item one</li> <li>list item tow</li> <li>list item three</li> <li>list item four</li> </ul> </div>
ul.pg50 { list-style-type : square; /* disc, circle, decimal-leading-zero, decimal, lower-roman, upper-roman, lower-greek, lower-alpha, lower-latin, upper-alpha, upper-latin, Hebrew, Armenian, Georgian, none */ }
图2-12
18. 使用图片作为列表项的前置图标
指定一张图片给列表风格图像list-style-image作为值。
<div class="pg51"> <ul class="pg52"> <li>list item one</li> <li>list item tow</li> <li>list item three</li> <li>list item four</li> </ul> </div>
ul.pg52 { list-style-image : url(bullet.gif); }
图2-13
19. 移除列表项的左边留白(即移除左边的缩进)
把列表风格类型(指前置图标)设置为none,再把左边的margin和padding设置为0值。
<div class="pg52"> <ul class="pg53"> <li>list item one</li> <li>list item tow</li> <li>list item three</li> <li>list item four</li> </ul> </div>
ul.pg53 { list-style-type : none; padding-left : 0; margin-left : 0; }
图2-14
20. 把列表项显示到同一个水平方向上
设置display属性值为inline可以把列表项都显示到水平方向上。
<div class="pg54"> <ul class="pg54horix"> <li>list item one</li> <li>list item tow</li> <li>list item three</li> <li>list item four</li> </ul> </div>
ul.pg54horix li{ display : inline; }
图2-15
(第二章 · 完)
发表评论
-
CSS float属性
2012-03-03 15:06 531下面http://www.w3school.com.cn对fl ... -
CSS文集(The CSS Anthology) 第四章 导航菜单栏
2012-02-18 23:38 0【占位符】 -
The CSS Anthology 第五章 Tabular Data (表格式数据)
2012-02-15 13:25 0[ PLACEHOLDER ] -
The CSS Anthology 第四章 Navigation导航栏(导航菜单)
2012-02-15 13:24 0[ PLACEHOLDER ] -
CSS文集(The CSS Anthology) 第三章 CSS和图片
2012-02-18 21:07 9401. 为图片加边框 以下CSS中,第一种是以详细方式进行设置, ... -
CSS文集《The CSS Anthology》 第二章 文本格式化及其它基础知识 (1)
2012-02-15 13:25 897第二章 文本格式化及其它基础知识(Text Styling a ... -
Web-Harvest: Set a Proxy Server
2011-06-09 11:36 1086InputSource is = new InputSourc ... -
Beanshell : Setting variables in WebHarvest scripts
2011-06-09 11:34 1827print("sys.isVariableDefin ... -
ExceptionUtils : A very useful class from apache commons
2011-06-09 11:23 901apache.commons.lang Exceptio ... -
调试内嵌的javascript
2011-06-09 11:22 764调试诸如: document.write('<scri ... -
JProfiler : 用JProfiler可以很容易发现Blocked掉的线程。
2011-06-09 11:20 831As title. -
WH : && => &&
2011-06-09 11:12 701<if condition="${ ( ... -
Web-Harvest: variables!!
2011-06-09 11:11 746Getting sized of a list ... -
Spring WebContextApplication
2011-06-09 11:11 663问题: Closing WebContextAppl ... -
Cygwin
2011-06-09 11:10 611在Windows下使用Linux中的常用工具!! -
eclipse : XXX cannot be resolved to a type
2011-06-09 11:09 1168Go to: [Project] \ [Clean.. ... -
GOOD practice : 字符串比较
2011-06-09 11:09 682对于字符串的比较和打印 一定要额外加引号 输出!! -
Spring : 隐藏的依赖
2011-06-09 11:09 639可以在 Bean 定义上加 attribute: &q ... -
Linux : 生成随机密码
2011-06-09 11:08 919生成 6 位随机密码 $ echo `< ... -
twitter : 搜索中文关键字时每个中文字要用空格分开
2011-06-09 11:07 815如题。
相关推荐
《THE CSS3 ANTHOLOGY:第四版》是由Rachel Andrew所著的一本全面介绍CSS3技术的图书。本书第四版更新于2012年3月,专注于讲解CSS3的最新特性与应用,旨在帮助读者将其网站设计提升至一个新高度。Rachel Andrew作为...
2. **第2章:文本样式和其他基础** - **文本样式**:探讨如何使用CSS来控制文本的字体、大小、颜色等属性。 - **段落样式**:介绍如何使用CSS来设置段落的对齐方式、行高、缩进等。 - **列表样式**:教授如何使用...
The CSS Anthology: 101 Essential Tips, Tricks & Hacks is a compilation of best practice solutions to the most challenging CSS problems. The third edition of this best-selling book, published in full ...
2. **Text Styling and Other Basics** - 文本样式和其他基础知识 - 字体、颜色和大小的控制方法。 - 如何设置文本对齐、行高和间距。 - 使用伪类和伪元素来增强文本效果。 3. **CSS and Images** - CSS与图像 ...
本章提供了JavaScript中日期对象的全面介绍,包括日期格式化和时区转换。 #### 10. 处理图像 图像在网页中起着重要作用。本章讨论了如何使用JavaScript加载、显示和操作图像,以及如何创建动态图像效果。 #### 11...
2. **DOM操作**:DOM(Document Object Model)是网页内容的结构化表示,JavaScript通过DOM API可以访问和修改网页元素。书中将详细讲解如何选择、创建、修改和删除DOM节点,以及如何利用事件监听来实现交互效果。 ...
- **知识点简介**:本章主要介绍WordPress的基础概念及环境搭建过程。 - **核心内容**: - 安装与配置WordPress的基本步骤; - 创建第一个WordPress站点; - 理解WordPress后台管理界面的基本操作。 - **第2章...
12. **CSS框架和设计模式**:如《CSS Anthology》、《O'Reilly CSS: The Definitive Guide》等,这些书籍提供了CSS的最佳实践和常见设计模式,帮助开发者写出更高效、可维护的CSS代码。 综上所述,HTML和CSS开发...
第二版的内容可能涵盖了CSS2.1及CSS3的新特性,如媒体查询、 Flexbox和Grid布局系统,这些对于响应式设计至关重要。 书中可能详细介绍了以下知识点: 1. **基础概念**:CSS的基本语法、选择器、属性和值,包括ID...
### JavaScript Anthology:101 Essential Tips, Tricks & Hacks #### 一、概述 《JavaScript Anthology:101 Essential Tips, Tricks & Hacks》是一本由James Edwards和Cameron Adams编写的经典JavaScript教程...
The WordPress Anthology puts you in the driver’s seat of this powerful & flexible open-source CMS, offering an extensive array of solutions for your projects. Jam-packed with proven tips & techniques...
- **Working with Dates and Times(日期与时间处理)**:日期和时间格式化的方法。 - **Detecting Browser Differences(检测浏览器差异)**:如何判断不同浏览器间的差异并作出相应调整。 - **Using JavaScript ...
第二部分可能涉及更高级的主题: 1. 高级PHP函数和特性:如字符串处理、正则表达式、日期时间处理、文件系统操作等。 2. PHP与数据库交互:深入讲解PDO(PHP Data Objects)和MySQLi扩展,以及如何编写高效的SQL...
《内存转储分析精选集》第二卷不仅为初学者提供了入门知识,还为有经验的读者提供了深入的技术细节。通过阅读本书,读者可以学习到如何有效地分析内存转储文件,解决复杂的技术问题,并提升自己的软件开发和维护技能...
### 《ThoughtWorks Anthology:软件技术与创新论文集》核心知识点提炼 #### 一、概述 《ThoughtWorks Anthology:软件技术与创新论文集》是一本汇集了ThoughtWorks工程师们在软件技术与创新领域多年积累的经验与...
标题和描述中提到的《Memory Dump Analysis Anthology, Volume 3 内存分析技术》是关于内存转储分析的一系列作品中的一卷。这部作品由Dmitry Vostokov编辑,并由Software Diagnostics Institute出版,属于《Memory ...