the lyf so short, the craft so long to lerne. - Chaucer
今天看李笑来的博客,说他两年内学了下面这些内容:
然后又看了这么一篇文章:
http://www.javaresearch.org/article/12568.htm我想我不会做一个程序员。我觉得这事要聪明人干呐。但我很想对这些东西有所认知。留着慢慢看看吧。一面遇到困难,一面四处求知弥补漏洞的那段日子,收获的滋味最畅快。
Posted by yuvia
the lyf so short, the craft so long to lerne. - Chaucer
今天看李笑来的博客,说他两年内学了下面这些内容:
然后又看了这么一篇文章:
http://www.javaresearch.org/article/12568.htmPosted by yuvia
一个本地化课程的资料。
Posted by yuvia
http://www.xiaocui.cn/blog/article.asp?id=161
Posted by yuvia
今天发现了已经被翻译完的一个版本。嗯,有点失望。不过反正我还是要继续学习,所以不会就此结束我的翻译!后来仔细对照了一下,还是有些地方不一致的。我只忠于我的原文就好了。
不过也要记住,在做事之前先观察好整个大背景环境。不要做重复劳动。
今天的内容还是很简单的一些东西。我记得第一次设计页面的时候被人问到id和class的区别。找了一篇文章,来解释这个问题>>>
喜欢的站点:http://www.w3school.com.cn/index.html
The CSS syntax is made up of three parts: a selector, a property and a value:
CSS语法由三部分组成:一个选择器,一个属性和一个值:
selector {property: value} |
The selector is normally the HTML element/tag you wish to define, the property is the attribute you wish to change, and each property can take a value. The property and value are separated by a colon, and surrounded by curly braces:
选择器一般就是你希望定义的HTML元素/标签,更改你希望更改的属性,给每个属性赋一个值。属性和值之间用冒号分割,二者由大括号包围:
body {color: black}
|
Note: If the value is multiple words, put quotes around the value:
注:如果值有多个单词构成,用引号引起来:
p {font-family: "sans serif"}
|
Note: If you wish to specify more than one property, you must separate each property with a semicolon. The example below shows how to define a center aligned paragraph, with a red text color:
注:同一选择器下的多个属性由分号分割。下面的例子演示了怎样将一个段落居中并将文字设为红色:
p {text-align:center;color:red}
|
To make the style definitions more readable, you can describe one property on each line, like this:
为了方便阅读,可以将各个属性分行展示:
p |
h1,h2,h3,h4,h5,h6 |
With the class selector you can define different styles for the same type of HTML element.
使用类选择器可以为同一类型的HTML元素定义不同的样式。
Say that you would like to have two types of paragraphs in your document: one right-aligned paragraph, and one center-aligned paragraph. Here is how you can do it with styles:
比如,你希望同一个文件中的段落有两种样式:一种居右,一种居中。你可以按照下面的方式定义:
p.right {text-align: right}
|
You have to use the class attribute in your HTML document:
这样,你就需要用类来定义HTML元素:
<p class="right"> <p class="center"> |
Note: To apply more than one class per given element, the syntax is:
注:如需给一个元素定义多个类,可以这样写:
<p class="center bold"> |
The paragraph above will be styled by the class "center" AND the class "bold".
这个段落就被同时赋予两个类,名字分别为“center”和“bold”。
You can also omit the tag name in the selector to define a style that will be used by all HTML elements that have a certain class. In the example below, all HTML elements with class="center" will be center-aligned:
如果你需要定义所有HTML元素中的某个类,需要将标签名去掉,如下例所示。此例中,所有具有“center”类厄HTML元素都会被居中显示:
.center {text-align: center}
|
In the code below both the h1 element and the p element have class="center". This means that both elements will follow the rules in the ".center" selector:
在下面的例子中,h1和p都有叫做“center”的类,这就说明,h1和p都要遵守“.center”这一选择器的规则:
<h1 class="center"> <p class="center"> |
Do NOT start a class name with a number! It will not work in Mozilla/Firefox. |
不要以数字为首命名一个类哦,这样将在火狐中失效。You can also apply styles to HTML elements with particular attributes.
一个已经具有某种属性的HTML元素仍然可以被定义样式。
The style rule below will match all input elements that have a type attribute with a value of "text":
下面的例子中,蓝色背景色的样式将对所有据有text属性值的input元素生效:
input[type="text"] {background-color: blue}
|
You can also define styles for HTML elements with the id selector. The id selector is defined as a #.
你也可以用id选择器来定义HTML元素的样式。id选择器以“#”号开头。
The style rule below will match the element that has an id attribute with a value of "green":
下列的样式举例中,所有据有“green”id属性的元素的文本内容都将被定义为绿色。
#green {color: green}
|
The style rule below will match the p element that has an id with a value of "para1":
下面的样式作用于所有据有“para1”id的所有段落(p)元素:
p#para1 |
Do NOT start an ID name with a number! It will not work in Mozilla/Firefox. |
不要以数字开头命名ID!这样样式将在火狐中失效。
Comments are used to explain your code, and may help you when you edit the source code at a later date. A comment will be ignored by browsers. A CSS comment begins with "/*", and ends with "*/", like this:
注释用来解释你的代码,可以帮助日后对源代码进行编辑。注释是不会被浏览器识别的。CSS注释以“/*”开始,以“*/”结束:
/* This is a comment */ |
Posted by yuvia
嗯,最近翻译东西,心想不如翻译我想学的东西。因此开始翻译CSS教程。8过初期的东西俺都懂,只是想做一个完整的教程。原文出处:http://www.w3schools.com/css/css_intro.asp
俺们要搬了,囧。搬到有很多男人的地方。。。请开始自行yy。。。
Before you continue you should have some basic understanding of the following:
If you want to study this subject first, find the tutorials on our Home page.
学CSS前,你得先会的东西想先学HTML / XHTML,请走这边。
With CSS, your HTML documents can be displayed using different output styles:
一个HTML可以因为不同样式表变得不同哦:
HTML tags were originally designed to define the content of a document. They were supposed to say "This is a header", "This is a paragraph", "This is a table", by using tags like <h1>, <p>, <table>, and so on. The layout of the document was supposed to be taken care of by the browser, without using any formatting tags.
As the two major browsers - Netscape and Internet Explorer - continued to add new HTML tags and attributes (like the <font> tag and the color attribute) to the original HTML specification, it became more and more difficult to create Web sites where the content of HTML documents was clearly separated from the document's presentation layout.
To solve this problem, the World Wide Web Consortium (W3C) - the non profit, standard setting consortium, responsible for standardizing HTML - created STYLES in addition to HTML 4.0.
All major browsers support Cascading Style Sheets.
HTML标签最初是为了定义文件内容制定的,例如<h1>,<p>,<table>它们表达不同的意义:“这是一个标头”,“这是一个段落”,“这是一个表格”,等等等等。如果没有格式标签,文件的页面布局由浏览器决定。
Netscape和IE作为两大主要浏览器,不断收录新的HTML标签(像<font>标签、颜色属性等)。这使得编写一个表达布局脱离HTML语言控制的网页越来越不可能了。
为了解决这个问题,负责制定HTML标准的非盈利组织W3C(万维网联盟)制定了样式这一概念。
所有主流浏览器均支持阅读层叠样式表。
Styles sheets define HOW HTML elements are to be displayed, just like the font tag and the color attribute in HTML 3.2. Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in your Web, just by editing one single CSS document!
CSS is a breakthrough in Web design because it allows developers to control the style and layout of multiple Web pages all at once. As a Web developer you can define a style for each HTML element and apply it to as many Web pages as you want. To make a global change, simply change the style, and all elements in the Web are updated automatically.
样式决定HTML元素的展示放肆,就像HTML 3.2时的字体标签和颜色属性一样,CSS一般存为外部.css格式的文件。外部样式表使你能够仅仅修改CSS文件,就轻易改变网页的外观和布局。
CSS使网页开发者能够一次性控制多个网页的样式和布局,是网页设计的一项重大突破。你可以为每项HTML元素编写一个样式,然后在多个网页中应用。小小改变一个样式,就能带动全局改变,所有的网页元素够跟着自动更新。
Style sheets allow style information to be specified in many ways. Styles can be specified inside a single HTML element, inside the <head> element of an HTML page, or in an external CSS file. Even multiple external style sheets can be referenced inside a single HTML document.
What style will be used when there is more than one style specified for an HTML element?
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style declared inside the <head> tag, in an external style sheet, or in a browser (a default value). Posted by yuvia
层叠顺序
一个HTML元素中被多个样式定义时,哪个被优先使用呢?
一般来说,所有的样式都被层叠起来,形成一个“虚拟的”新样式表。各项样式按照下列顺序排列,优先级由小到大。
1. 浏览器默认样式
2. 外部样式表
3. 内部样式表(定义在<head>标签部分)
4. 内嵌样式(在HTML元素内部定义)
所以,内嵌样式(在HTML元素内部定义)具有最高优先级,可以覆盖内部样式表、外部样式表和浏览器(默认值)中的样式定义。
Posted by yuvia
Posted by yuvia
Posted by yuvia
Posted by yuvia
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1 LAST_MODIFIED="1123163518">Bookmarks</H1>
IE的:
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
把头部换成目标浏览器的就OK了。收藏夹不再呈乱码状。但是韩语搞不过来。莔。
Posted by yuvia
我和我的一二三四天
- yuvia
| 日 | 一 | 二 | 三 | 四 | 五 | 六 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 |