Andrew.Goal's profileAndrew Goal's BlogPhotosBlogListsMore Tools Help

Andrew Goal's Blog

November 16

CSS 理论+工具+实践


关于 CSS
理论+工具+实践

理论
布局方案 Positioning schemes
浏览器的核心之一叫做布局引擎 比如火狐的布局引擎是gecko
html元素在浏览器中通过css进行布局时 有四种布局方案
静态定位 也称为正常流定位 (默认方式) 所谓流 是通过流动模型 传达布局原理 html元素向左上角流动
绝对定位 (请思考 绝对定位中 坐标系的原点在哪里 )
相对定位(请注意是相对于在流定位中应该出现的位置)
fixed定位 直接针对浏览器的viewport 定位

盒子模型 box model
而每一个元素在被浏览器布局之前 首先被render为一个个box

我们现在的水平 学习这方面理论 应该直接看 w3的css 规范
 Box model
Visual formatting model

当然 理论是简单的 现实是复杂的 css在不同浏览器上的表现 非常的不一致 参见 acid 测试
所以有时 你需要 去w3schools 看看 这里是很务实的文档
http://www.w3schools.com/css/css_boxmodel.asp
这方面的书籍可以看看 css禅意花园


工具
学习css 最好的工具还是firebug
另外 实在忍不住 称赞一下 netbeans 在遵循标准方面的努力 编辑html时你得到的帮助 直接就是w3的规范 包括代码自动完成也严格按照dtd

实践
主要是通过工具学习理论
同样的firebug 在我手里就是强大的工具 在很多人手上 只不过是个很平庸的工具
firebug的已经把box模型做进去了 而且非常直观 但看的懂的人不多
另外 很多人因为缺乏探索精神 不知道 firebug 其实就是人们梦寐以求的 html+css的调试工具
也就是说 在firebug里面 可以直接编辑html (增删改查)  然后立即看效果
同样直接编辑css 立即看到效果 而且通过上下方向键 可以代码自动完成
虽然不能像Dreamweaver中那样 鼠标拖着层 直接跑
但通过上下方向键改变非静态定位元素的offset(盒子模型上)或者css里面的left top bottom right值 完全可以让html元素在页面里跑起来 简直就是在玩游戏 方向键操纵

调试完的结果 copy到页面源码中即可 彻底告别两眼一抹黑的编程方式


October 17

Google Notebook Extension for Firefox 3.5+

Friday, June 19, 2009

Google Notebook Extension for Firefox 3.5+

Well, it was going to happen. Mozilla upgrades Firefox to 3.5, Yeah! :-) ,but breaks the Google Notebook extension, booh :-(

So the usual work around is to change the maxVersion value in the extension as described on 'Google Operting System'
If you use a beta version of Firefox 3.5, here's a way to install the extension:

* save the extension to your computer: right-click and select "save link as".
* download 7-zip, an excellent open-source software for archiving files, and install it.
* right-click on the extension (google-notebook.xpi), click on "7-zip" and then on "open archive". Right-click on "install.rdf", select "Edit" and replace "3.0.*" with "3.5.*". Save the file, close Notepad and update the archive.
* now you can drag the .xpi file to your browser and install the extension.
I have done this and will most likely continue to maintain the modified version for as long as I continue to use Google Notebook and as long as the extension will work with Firefox.

You can download this modified extension here for Firefox 3.5

©2008 Google Terms of Service

Installation:
  1. Click the Add to Firefox button.
  2. A download file dialogue box will open.
  3. Select Save File and press OK.
  4. Save the file to your PC Desktop or some other folder.
  5. In Firefox open the File menu and select Open File.
  6. Browse to the google-notebook.xpi file you downloaded and press Open.
  7. The Firefox Add-ons software installation window will open, press Install.
  8. The Google Notebook Extension will now install as normal.
at 7:31 AM
September 19

从易经占卜的随机性一路找到的网站

http://members.iimetro.com.au/~lofting/IChingPlus/
刚找到这个网站不久 挺兴奋的  前几天从占卜的概率->随机数->程序中常用的伪随机数->发现随机是通天的概念(哲学上的自由意志 决定论)->上帝是玩骰子还是不玩->量子力学->量子力学与易经的关系->找到这个网站 呵呵


September 15

浏览器为何不开放 查看某个html dom元素上注册的所有事件处理函数的接口? 感觉挺奇怪的 难道有什么安全隐患? 续

比如一个<Button> 用addEventListener 对click事件 添加多个处理函数 却没有接口查看当前这个Button的click事件共有几个处理函数 更别说遍历每个处理函数了

似乎必须自己维护有哪些观察者

这样的机制给接手别人的程序带来很大麻烦 因为你很难定位到兴趣代码

浏览器为何不开放 查看某个html dom元素上注册的所有事件处理函数的接口? 感觉挺奇怪的 难道有什么安全隐患?

浏览器为何不开放 查看某个html dom元素上注册的所有事件处理函数的接口? 感觉挺奇怪的 难道有什么安全隐患?
 

Andrew.Goal

微软的空间有过滤
我的blog完整版:
http://androidgao.blogspot.com
感谢访问!
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.
Ziyuan LIwrote:
winlivespace也有過濾呀?? 可惜blogspot只能翻墻看
July 25
Photo 1 of 9