<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>寂静的深海 &#187; hack</title>
	<atom:link href="http://www.deepseath.com/?feed=rss2&#038;tag=hack" rel="self" type="application/rss+xml" />
	<link>http://www.deepseath.com</link>
	<description></description>
	<lastBuildDate>Mon, 29 Jan 2024 09:55:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>CSS浏览器兼容问题整理(转)</title>
		<link>http://www.deepseath.com/?p=371</link>
		<comments>http://www.deepseath.com/?p=371#comments</comments>
		<pubDate>Mon, 27 Oct 2008 07:11:40 +0000</pubDate>
		<dc:creator>Deepseath</dc:creator>
				<category><![CDATA[日积月累]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[round]]></category>
		<category><![CDATA[升级]]></category>
		<category><![CDATA[浏览器]]></category>
		<category><![CDATA[补丁]]></category>
		<category><![CDATA[转载]]></category>

		<guid isPermaLink="false">http://www.deepseath.com/?p=371</guid>
		<description><![CDATA[若干个浏览器内核不同CSS解析可能就不同，甚至同一个内核的浏览器版本不同解析也可能不同:( 页面的CSS对于写程序虽然不是非常重要，不过就解决事情的一个整体流程而言，多多了解一些绝对没有坏事！ 这又是一个整理并转载别人的总结。说实话，不太喜欢用一些Hack之类的，我写CSS的时候基本就是用手册和标准规定的东西。然后再打开不同浏览器发现问题，然后根据具体情况具体写，不过有时候某些变态问题真的很麻烦:( 浏览器真的是一个朝三暮四的讨厌家伙，希望什么时候各个浏览器都能遵循标准来解析，让页面不再用Hack！ 同时，也呼吁一下大家将自己的浏览器升级一下吧，7年前的IE6真的不怎么地！！换IE7吧！！ 不罗嗦了，开始——转—— 1.div的垂直居中问题： vertical-align:middle; 将行距增加到和整个DIV一样高 line-height:200px; 然后插入文字，就垂直居中了。缺点是要控制内容不要换行。 2. margin加倍的问题： 设置为float的div在ie下设置的margin会加倍。这是一个ie6都存在的bug。解决方案是在这个div里面加上display:inline;&#160;&#160;&#160; 例如：&#160;&#160;&#160; &#60;#div id=”imfloat”&#62;&#160;&#160;&#160; 相应的css为&#160;&#160;&#160; #IamFloat{&#160;&#160;&#160; float:left;&#160;&#160;&#160; margin:5px;/*IE下理解为10px*/&#160;&#160;&#160; display:inline;/*IE下再理解为5px*/} 3.浮动ie产生的双倍距离： #box{ float:left; width:100px; margin:0 0 0 100px; //这种情况之下IE会产生200px的距离 display:inline; //使浮动忽略}&#160;&#160;&#160; 这里细说一下block与inline两个元素：block元素的特点是,总是在新行上开始,高度,宽度,行高,边距都可以控制(块元素);Inline元素的特点是,和其他元素在同一行上,不可控制(内嵌元素);&#160;&#160;&#160; #box{ display:block; //可以为内嵌元素模拟为块元素 display:inline; //实现同一行排列的效果 diplay:table; 4.IE与宽度和高度的问题： IE 不认得min-这个定义，但实际上它把正常的width和height当作有min的情况来使。这样问题就大了，如果只用宽度和高度，正常的浏览器里这两个值就不会变，如果只用min-width和min-height的话，IE下面根本等于没有设置宽度和高度。&#160;&#160;&#160; 比如要设置背景图片，这个宽度是比较重要的。要解决这个问题，可以这样：&#160;&#160;&#160; #box{ width: 80px; height: 35px;}html&#62;body #box{ width: auto; height: auto; min-width: [...]]]></description>
		<wfw:commentRss>http://www.deepseath.com/?feed=rss2&#038;p=371</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>收集整理一些IE与FF的CSS兼容设计问题</title>
		<link>http://www.deepseath.com/?p=214</link>
		<comments>http://www.deepseath.com/?p=214#comments</comments>
		<pubDate>Fri, 27 Jun 2008 09:28:25 +0000</pubDate>
		<dc:creator>Deepseath</dc:creator>
				<category><![CDATA[日积月累]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[浏览器]]></category>

		<guid isPermaLink="false">http://www.deepseath.com/?p=214</guid>
		<description><![CDATA[margin加倍的问题。 设置为float的div在ie下设置的margin会加倍。这是一个ie6都存在的bug。 解决方案是在这个div里面加上display:inline; 例如： &#60;div id=”float”&#62;&#60;/div&#62;相应的css为#float{float:left; margin:5px;/*IE下理解为10px*/ display:inline;/*IE下再理解为5px*/ } 下面是关于IE7的hack： 针对firefox ie6 ie7的css样式： 现在大部分都是用!important来hack，对于ie6和firefox测试可以正常显示，但是ie7对!important可以正确解释，会导致页面没按要求显示！找到一个针对IE7不错的hack方式就是使用“*+html”，现在用IE7浏览一下，应该没有问题了。 现在写一个CSS可以这样：#1 { color: #333; } /* Moz */ * html #1 { color: #666; } /* IE6 */ *+html #1 { color: #999; } /* IE7 */ 那么在firefox下字体颜色显示为#333，IE6下字体颜色显示为#666，IE7下字体颜色显示为#999 可以用”+”来实现只有IE识别的CSS Hack 可能有朋友想到用”_” Hack，但它们是由区别的，因为IE7中是不识别“_”的。所以用+测试结果： IE5.5，IE6 ，IE7浏览器都能识别； FF2.0，Opera 9，Safari 2浏览器不识别。]]></description>
		<wfw:commentRss>http://www.deepseath.com/?feed=rss2&#038;p=214</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>两个不太常用的 CSS Hack</title>
		<link>http://www.deepseath.com/?p=211</link>
		<comments>http://www.deepseath.com/?p=211#comments</comments>
		<pubDate>Fri, 27 Jun 2008 05:28:32 +0000</pubDate>
		<dc:creator>Deepseath</dc:creator>
				<category><![CDATA[日积月累]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://www.deepseath.com/?p=211</guid>
		<description><![CDATA[1、仅 Safari 和 Opera 识别的 Hack @media all and (min-width: 0px) { /* Safari and Opera  rules here */ } 或者 @media screen and (-webkit-min-device-pixel-ratio:0) { /* Safari and Opera rules here */ } 注：这里所指代的 Safari 和 Opera 一般为最新版本。 2、仅 Firefox 3 和 IE7 识别的 Hack selector, x:-moz-any-link, x:default { /* Firefox 3  and IE7 [...]]]></description>
		<wfw:commentRss>http://www.deepseath.com/?feed=rss2&#038;p=211</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
