??xml version="1.0" encoding="utf-8" standalone="yes"?>
1.不要看到别h的回复第一句话pQ给个代码吧Q你应该xZ么。当你自己想
出来再参考别人的提示Q你q道自己和别h思\的差异?nbsp;
2.初学者请不要看太多太多的书那会误人子弟的Q先找本pȝ的学Q很多h用了很久
都是只对部分功能熟悉而已Q不pȝq是不够的?nbsp;
3.看帮?不要因ؓ很难而自己是初学者所以就不看Q帮助永q是最好的参考手册,
虽然帮助的文字有时候很隄懂,总觉得不够直观?nbsp;
4.不要被对象、属性、方法等词汇所qhQ最Ҏ的是先了解最基础知识?nbsp;
5.不要放过M一个看上去很简单的问?-他们往往q不那么单,或者可以引?nbsp;
出很多知识点Q不会D一反三你就永远学不会?nbsp;
6.知道一点东西,q不能说明你会写脚本Q脚本是需要经验积累的?nbsp;
7.学脚本ƈ不难QJSP、ASP、PHP{等也不q如?-隄是长期坚持实践和不遗余力的博?nbsp;
书Q?nbsp;
8.看再多的书是学不全脚本的Q要多实?nbsp;
9.把时髦的技术挂在嘴边,q不如把q时的技术记在心里;
10.学习脚本最好的Ҏ之一是多练习;
11.在Q何时刻都不要认ؓ自己手中的书已经_了;
12.看得懂的书,请仔l看Q看不懂的书Q请着头皮看;
13.别指望看W一遍书pC和掌握什么——请看第二遍、第三遍Q?nbsp;
14.h书上的例子亲手到电脑上实践,即配套光盘中有源文Ӟ
15.把在书中看到的有意义的例子扩充;q将其切实的q用到自q工作中;
16.不要漏掉书中M一个练习——请全部做完q记录下思\Q?nbsp;
17.当你用脚本到一半却发现自己用的Ҏ很拙劣时Q请不要马上停手Q请快余
下的部分_略的完成以保证q个代码的完整性,然后分析自己的错误ƈ重新~写和工
作?nbsp;
18.别心急,写脚本确实不ҎQ水qx在不断的实践中完善和发展的;
19.每学C个脚本难点的时候,试着对别解这个知识点q让他理?---你能
讲清楚才说明你真的理解了Q?nbsp;
20.记录下在和别Z时发现的自己忽视或不理解的知识点;
21.保存好你做过的所有的源文?---那是你最好的U篏之一Q?nbsp;
22.对于|络Q还是希望大家能多利用一下,很多问题不是非要到论坛来问的Q首?nbsp;
你要学会自己扄案,比如google、百度都是很好的搜烦引擎Q你只要输入关键字就
能找到很多相兌料,别老是{待别hl你希望Q看的出你^时一定也很懒Q?nbsp;
23Q到一个论坛,你学会去看以前的帖子Q不要什么都不看发帖子问,也许你的?nbsp;
题早有人问q了Q你再问Q别人已l不惛_重复了,做ؓ初学者,谁也不希望自?nbsp;
的帖子没人回的?nbsp;
24Q虽然不是打d学者,但是q句话还是要_论坛论坛Q就是大家讨论的地方Q?nbsp;
如果你L望有高手L偿指点你Q除非他是你亲戚Q!讨论者,L是水q相当的
才有讨论的说法,如果水^真差距太q了Q连基本操作都需要别人给解答Q谁q跟?nbsp;
讨论呢?nbsp;
躁的hҎ问:我到底该学什么;----别问Q学对了;
躁的hҎ问:Js有钱途吗Q?---你去抢银行;
躁的hҎ_我要中文版!我英文不行!----不行Q学呀Q?nbsp;
躁的h分两U:只观望而不学的人;只学而不坚持的hQ?nbsp;
躁的h永远不是一个高手?/strong>
]]>
在这章我们将学习刎ͼ
1.Fixed- and flexible-width rounded-corner boxes
2.The sliding doors technique
3.Mountaintop corners
4.CSS drop shadows
5.PNG transparency support for Internet Explorer 5.x and above
6.Image replacement
基本的背景图?/strong>
body {
background:url(pattern.gif);
}
body {
background: #ccc url(gradient.gif) repeat-x;
}
#branding {
width: 700px;
height: 200px;
background:url(/images/branding.gif) no-repeat;
}
h1 {
padding-left: 30px;
background: url(/images/bullet.gif) no-repeat left center;
}
h1 {
padding-left: 30px;
background: url(/images/bullet.gif) no-repeat 0 50%;
}
Rounded-corner boxes
.box {
width: 418px;
background: #effce7 url(images/bottom.gif) no-repeat left bottom;
}
.box h2 {
background: url(images/top.gif) no-repeat left top;
}
.box h2 {
padding: 10px 20px 0 20px;
}
.box p {
padding: 0 20px 10px 20px;
}
<div class="box">
<h2>Headline</h2>
<p>Content</p>
</div>
.box {
width: 424px;
background: url(images/bg-tile.gif) repeat-y;
}
.box h2 {
background: url(images/bg-top.gif) no-repeat left top;
padding-top: 20px;
}
.box .last {
background: url(images/bg-bottom.gif) no-repeat left bottom;
padding-bottom: 20px;
}
.box h2, .box p {
padding-left: 20px;
padding-right: 20px;
}
<div class="box">
<h2>Headline</h2>
<p class="last">Content</p>
</div>
Flexible rounded-corner box
.box {
width: 20em;
background: #effce7 url(images/bottom-left.gif)
no-repeat left bottom;
}
.box-outer {
background: url(images/bottom-right.gif) no-repeat right bottom;
padding-bottom: 5%;
}
.box-inner {
background: url(images/top-left.gif) no-repeat left top;
}
.box h2 {
background: url(images/top-right.gif) no-repeat right top;
padding-top: 5%;
}
.box h2, .box p {
padding-left: 5%;
padding-right: 5%;
}
<div class="box">
<div class="box-outer">
<div class="box-inner">
<h2>Headline</h2>
<p>Content</p>
</div>
</div>
</div>
Mountaintop corners
.box {
width: 20em;
background: #effce7 url(images/bottom-left.gif)
no-repeat left bottom;
}
.box-outer {
background: url(images/bottom-right.gif) no-repeat right bottom;
padding-bottom: 5%;
}
.box-inner {
background: url(images/top-left.gif) no-repeat left top;
}
.box h2 {
background: url(images/top-right.gif) no-repeat right top;
padding-top: 5%;
}
.box h2, .box p {
padding-left: 5%;
padding-right: 5%;
}
<div class="box">
<div class="box-outer">
<div class="box-inner">
<h2>Headline</h2>
<p>Content</p>
</div>
</div>
</div>
Drop shadows
Easy CSS drop shadows
.img-wrapper {
background: url(images/shadow.gif) no-repeat bottom right;
clear: right;
float: left;
}
.img-wrapper img {
margin: -5px 5px 5px -5px;
}
<div class="img-wrapper"><img src="dunstan.jpg" width="300"
height="300" alt="Dunstan Orchard" /></div>
.img-wrapper img {
background-color: #fff;
border: 1px solid #a9a9a9;
padding: 4px;
margin: -5px 5px 5px -5px;
}
.img-wrapper {
background: url(images/shadow.gif) no-repeat bottom right;
clear: right;
float: left;
position: relative;
}
.img-wrapper img {
background-color: #fff;
border: 1px solid #a9a9a9;
padding: 4px;
display: block;
margin: -5px 5px 5px -5px;
position: relative;
}
Drop shadows a la Clagnut
.img-wrapper {
background: url(images/shadow.gif) no-repeat bottom right;
float:left;
line-height:0;
}
.img-wrapper img {
background:#fff;
padding:4px;
border:1px solid #a9a9a9;
position:relative;
left:-5px;
top:-5px;
}
Fuzzy shadows
.img-wrapper {
background: url(images/shadow.gif) no-repeat right bottom;
float: left;
}
.img-wrapper div {
background: url(images/mask.png) no-repeat left top !important;
background: url(images/mask.gif) no-repeat left top;
padding: 0 5px 5px 0;
float: left; /* :KLUDGE: Fixes problem in IE5.2/Mac */
}
.img-wrapper img {
background-color: #fff;
border: 1px solid #a9a9a9;
padding: 4px;
}
<div class="img-wrapper">
<div>
<img src="dunstan.jpg" width="300" height="300" alt="Dunstan" />
</div>
</div>
Onion skinned drop shadows
.img-wrapper {
background:url(images/shadow.gif) no-repeat right bottom;
float: left;
}
.img-outer {
background:url(images/bottom-left2.gif) no-repeat left bottom;
float: left; /* :KLUDGE: Fixes problem in IE5.2/Mac */
}
.img-inner {
background:url(images/top-right2.gif) no-repeat top right;
padding: 0 5px 5px 0;
float: left; /* :KLUDGE: Fixes problem in IE5.2/Mac */
}
.img-wrapper img {
background-color: #fff;
border: 1px solid #a9a9a9;
padding: 4px;
display: block;
}
<div class="img-wrapper">
<div class="img-outer">
<div class="img-inner">
<img src="images/dunstan.jpg" width="300" height="300"
alt="Dunstan" />
</div>
</div>
</div>
Image replacement
Fahrner Image Replacement (FIR)
h2 {
background:url(hello_world.gif) no-repeat;
width: 150px;
height: 35px;
}
span {
display: none;
}
<h2>
<span>Hello World</span>
</h2>
Phark
h2 {
text-indent: -5000px;
background:url(hello_world.gif) no-repeat;
width: 150px;
height:35px;
}
<h2>
Hello World
</h2>
Gilder/Levin method
h2 {
width: 150px;
height: 35px;
position: relative;
}
h2 span {
background: url(hello_world.gif) no-repeat;
position: absolute;
width: 100%;
height: 100%;
}
<h2>
<span></span>Hello World
</h2>
1.盒子模式的复杂和特征
2.怎样q且Z么页边空白收~?br>3.l对位置和相对位|的不同
4.floating ?clearing怎样工作
Box model recap
* {
margin: 0;
padding: 0;
}
#myBox {
margin: 10px;
padding: 5px;
width: 70px;
}
Margin collapsing
Positioning recap
Relative positioning 相对位置
#myBox {
position: relative;
left: 20px;
top: 20px;
}
Absolute positioning l对位置
#branding {
width: 700px;
height: 100px;
position: relative;
}
#branding .tel {
position: absolute;
right: 10px;
bottom: 10px;
text-align: right;
}
<div id="branding">
<p class="tel">Tel: 0845 838 6163</p>
</div>
Floating
Line boxes and clearing
.news {
background-color: gray;
border: solid 1px black;
}
.news img {
float: left;
}
.news p {
float: right;
}
<div class="news">
<img src="news-pic.jpg" />
<p>Some text</p>
</div>
.news {
background-color: gray;
border: solid 1px black;
}
.news img {
float: left;
}
.news p {
float: right;
}
.clear {
clear: both;
}
<div class="news">
<img src="news-pic.jpg" />
<p>Some text</p>
<div class="clear"></div>
</div>
更简LҎ如下:
.news {
background-color: gray;
border: solid 1px black;
float: left;
}
.news img {
float: left;
}
.news p {
float: right;
}
<div class="news">
<img src="news-pic.jpg" />
<p>Some text</p>
</div>
我所用的工具
UltraEdit
IE 览?/p>
W?章?打下基础
在这章我们将学习刎ͼ
1.一个好的结构的重要性和有意义的文档
2.~写最优方?br />3.共有的编写错?br />4.文档cdQDOCTYPE switching和浏览器样式
5.建立自己的样?br />6.层叠Q特征和l承
(X)html包括很多元素。例?/p>
h1,h2,..
ul,ol,dl
strong,em
blockquote,cite
abbr,acronym,code
fieldset,legend,label
caption,thead,tbody,tfoot
IDs 和类?class names)
<ul id="mainNav">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact</a></li>
</ul>
Divs ?spans
<div id="mainNav">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Contact</li>
</ul>
</div>
?/p>
<ul id="mainNav">
<li>Home</li>
<li>About Us</li>
<li>Contact</li>
</ul>
<h2>Where’s Durstan?</h2>
<p>Published on <span class="date">March 22nd, 2005</span>
by <span class="author">Andy Budd</span></p>
DOCTYPE switching
(X)HTML 文档遵@的文档类型定?DTD)?/p>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
建立自己的样?/font>
Common selectors
Type selectors
p {color: black;}
descendant selectors
li a {text-decoration: none;}
ID and class selectors
#intro {font-weight: bold;} #mainContent h1 {font-size: 1.8em;}
Pseudo-classes
/* makes all unvisited links blue */ /* makes all visited links green */ /* makes links red when hovered or activated */ /* makes table rows red when hovered over */ /* makes input elements yellow when focus is applied */
The universal selector
* {
Advanced selectors
Child and adjacent sibling selectors
#nav > li {font-weight: bold;} 覆盖 q
Attribute selectors
<abbr title="Cascading Style Sheets">CSS</abbr> abbr[title] {border-bottom: 1px dotted #999;} a[rel="nofollow"] { .intro {border-style: solid;} a[rel~="friend"] {background-image: url(friend.gif);}
"
"
"
a {text-decoration: underline;}
h1 {font-weight: bold;}
.datePosted {color: green;}
<p id="intro">Some Text</p>
<p class="datePosted">24/3/2006</p>
#secondaryContent h1 {font-size: 1.2em;}
<div id="mainContent">
<h1>Welcome to my site</h1>
...
</div>
<div id="secondaryContent">
<h1>Latest news</h1>
...
</div>
a:link {color:blue;}
a:visited {color:green;}
a:hover, a:active {color:red;}
tr:hover {background-color: red;}
input:focus {background-color:yellow;}
IE 6 ?:focus不支?/p>
padding: 0;
margin: 0;
}
<ul id="nav">
<li>Home</li>
<li>Services
<ul>
<li>Design</li>
<li>Development</li>
<li>Consultancy</li>
</ul>
</li>
<li>Contact Us </li>
</ul>
#nav li {font-weight: bold;}
#nav li * {font-weight: normal;}
h1 + p {font-weight: bold;}
<h1>Main Heading</h1>
<p>First Paragraph</p>
<p>Second Paragraph</p>
abbr[title]:hover {cursor: help;}
background-image: url(nofollow.gif);
padding-right: 20px;
}
[class="intro"] {border-style: dotted;}
<a href="John Hicks
</a>
]]>
如图上所C?MusicBoxDemo代表了客L角色,它只依赖于IMusicBox界面,而不兛_是如何实现的.如何产生IMusicBox由MusicBoxFactory完成.以一个简单的E序来实C面这个UMLcd:
public interface IMusicBox {
public void play();
}
public class PianoBox implements IMusicBox {
public void play() {
System.out.println("播放钢琴音乐:)");
}
}
public class ViolinBox implements IMusicBox {
public void play() {
System.out.println("播放提琴音乐^_^");
}
}
public class MusicBoxFactory {
public static IMusicBox createMusicBox(String name)
throws InstantiationException,
IllegalAccessException,
ClassNotFoundException {
// q边使用的是Java的Reflection机制来生实?br /> // 不过客户端不用管?br /> // 以后q改变了这边的E序Q客LE序是不用更改的
return (IMusicBox) Class.forName(name).newInstance();
}
}
public class MusicBoxDemo {
public static void main(String[] args) throws Exception {
playMusicBox(MusicBoxFactory.createMusicBox("PianoBox"));
playMusicBox(MusicBoxFactory.createMusicBox("ViolinBox"));
}
public static void playMusicBox(IMusicBox musicBox) {
musicBox.play();
}
}
׃客户端只依赖与IMusicBox介面Q所以即使您日后改变了createMusicBox()中的实现方式Q对客户端是一点媄响也没有?
来看看Simple Factory的类l构Q?br />
客户只要面对FactoryQ客户依赖于产品介面Q品的具体实现是可以与客戶隔开的,它们也是可以抽换?
Z验证你的表是按你期望的方式创建,使用一个DESCRIBE语句Q?/p>
mysql> DESCRIBE pet;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| name | varchar(20) | YES | | NULL | |
| owner | varchar(20) | YES | | NULL | |
| species | varchar(20) | YES | | NULL | |
| sex | char(1) | YES | | NULL | |
| birth | date | YES | | NULL | |
| death | date | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
你可以随时用DESCRIBEQ例如,如果你忘记表中的列的名称或类型时?/p>
2.DISTINCT
h意该查询只是单地索每个记录的owner列,q且他们中的一些出现多ơ?br />Z使输出减到最,增加关键字DISTINCT索出每个唯一的输录:
mysql> SELECT DISTINCT owner FROM pet;
3.ORDER BY
你可能已l注意到前面的例子中l果行没有以特定的顺序显C?br />然而,当行按某U方式排序时Q检查查询输出通常更容易?br />Z排序l果Q用ORDER BY子句?/p>
mysql> SELECT name, birth FROM pet ORDER BY birth;
默认排序是升序ASCQ最的值在W一。要想以降序排序Q?br />在你正在排序的列名上增加DESCQ降序)关键?/p>
mysql> SELECT name, birth FROM pet ORDER BY birth DESC;
4.GROUP BY
使用GROUP BYҎ个owner的所有记录分l?br />COUNT( )和GROUP BY以各U方式分cM的数据。下列例子显C出q行动物普查操作的不同方式?/p>
每种动物的数量:
mysql> SELECT species, COUNT(*) FROM pet GROUP BY species;
+----------------+--------------+
| user() | current_date |
+----------------+--------------+
| root@localhost | 2006-10-18 |
+----------------+--------------+
如果你决定不x行正在输入过E中的一个命令,输入\c取消它:
mysql> select
-> user()
-> \c
mysql>
我的W一?/span> CSS
<html>
<head>
<title></title>
<style type="text/css">
p{
color : red ;
}
.date{
color : green ;
}
#intro {font-weight: bold;}
.datePosted {color: green;}
#mainContent h1 {font-size: 1.8em;}
#secondaryContent h1 {font-size: 1.2em;}
a:hover{
color : #FF0080 ;
}
a:active{
color : #0080FF ;
}
#nav li {font-weight: bold;}
</style>
</head>
<body>
<p>i'm red</p>
<a href="#">
你好
</a>
<div id="mainNav">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Contact</li>
</ul>
</div>
<h2>Where’s Durstan?</h2>
<p>Published on <span class="date">March 22nd, 2005</span>
by <span class="author">Andy Budd</span></p>
<p id="intro">Some Text</p>
<p class="datePosted">
<div id="mainContent">
<h1>Welcome to my site</h1>
...
</div>
<div id="secondaryContent">
<h1>Latest news</h1>
...
</div>
<ul id="nav">
<li>Home</li>
<li>Services
<ul>
<li>Design</li>
<li>Development</li>
<li>Consultancy</li>
</ul>
</li>
<li>Contact Us </li>
</ul>
</body>
</html>