近日整理的2月笔记 Don't drift along

DB

来自 Understanding MySQL Internal的好句子:
If you drift along, seeking only the pleasure of the moment and staying safely within your natural comfort zone, you do not accomplish much.
 
Good things happen when you push yourself outside of your comfort zone, doing what is difficult but what you know deep inside is the right thing to do. 
 
Growth comes through challenges. 
 
The devil is in the details.
 
 

LINUX

X Window系统X Window System ,也常稱為 X11X )是一种以 位图 方式显示的軟體 視窗系統
今日知名的 桌面環境 —— GNOMEKDE 也都是以X Window系统為基礎建構成的。
 

CSS

Div元素不设置width属性时,实际宽度如何决定?
 
结论:是水平扩展占满浏览器窗口。
 
内边距、边框和外边距都是可选的,默认值是零。但是,许多元素将由用户代理样式表设置外边距和内边距。可以通过将元素的 margin 和 padding 设置为零来覆盖这些浏览器样式。这可以分别进行,也可以使用通用选择器对所有元素进行设置:
* {
  margin: 0;
  padding: 0;
}
外边距可以是负值,而且在很多情况下都要使用负值的外边距。
 
一旦为页面设置了恰当的 DTD,大多数浏览器都会按照上面的图示来呈现内容。然而 IE 5 和 6 的呈现却是不正确的。根据 W3C 的规范,元素内容占据的空间是由 width 属性设置的,而内容周围的 padding 和 border 值是另外计算的。不幸的是,IE5.X 和 6 在怪异模式中使用自己的非标准模型。这些浏览器的 width 属性不是内容的宽度,而是内容、内边距和边框的宽度的总和。

虽然有方法解决这个问题。但是目前最好的解决方案是回避这个问题。也就是,不要给元素添加具有指定宽度的内边距,而是尝试将内边距或外边距添加到元素的父元素和子元素。

 

JS

谁是谁的Prototype???
 
//Animal
 function Animal() {
        this.name = "aminal";
        this.sayPrototype = function(){
            console.log("\n"+this.name+" said its prototype is :");
    console.log(this.__proto__);
};
 }
 
 //Dog
 function Dog() {
        this.name = "dog";
 }
 Dog.prototype = new Animal();
 
 //main
 $(function () {
        var dog = new Dog();
        dog.sayPrototype();
 
var animal = new Animal();
animal.sayPrototype();
 });
 
 
结果是:?
 
改写Animal
//Animal
 function Animal() {
        this.name = "aminal";
this.sayPrototype = function(){
console.log(this.name+":");
console.log(this);
};
 }
 
结果是:?
 
 
 
 

转载于:https://www.cnblogs.com/hotspot/archive/2013/03/23/2977117.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值