小小体验一把 HTML5

发布时间:July 5, 2010分类:写写程序.Code
作者:HJin.me
评论: 3 条

1349390903_722e710a8294a931fedf46bb9d1e7a74.jpg

无聊地无聊地把模板文件改写了一下,换上了一些 html5 的标签,很初步地尝试和了解了一下 html5

好在现在网上关于 html5 的信息很多,当然也包括 html5 在浏览器兼容方面的问题。

简单的 display:block; 就可以让很多浏览器兼容好。

对于 IE 和某些特殊的浏览器就得用 javascript 或者其他方法来解决问题了。

可以参考一下这篇文章:《How to get html5 working in ie and firefox2

IE对float对象背景图片的渲染错误

发布时间:January 29, 2009分类:做做美工.Design
作者:HJin.me
评论: 4 条

这个css问题就是在我写这个博客的新皮肤的时候发现的。我简单的测试了一下IE6,IE7,IE8beta1都存在该问题。问题代码如下


  1. <style> 
  2. #sidebar { background:url(http://huangj.in/templates/One%20in%20Spring/img/bottomm.gif) repeat #093;  } 
  3.     #sidebar ul { float:left; } 
  4. .clear {clear:both;} 
  5. </style> 
  6. <div id="sidebar"> 
  7.   <ul> 
  8.     <li>ul1 第一行 长度宽一点点</li> 
  9.     <li>ul1 第二行</li> 
  10.     <li>ul1 第三行</li> 
  11.   </ul> 
  12.   <ul> 
  13.     <li>ul2 第一行</li> 
  14.     <li>ul2 第二行</li> 
  15.     <li>ul2 第三行</li> 
  16.   </ul> 
  17. <div class="clear"></div>   
  18. </div> 

演示地址


http://huangj.in/demo/iefloatbg.html

用宽度较大的浏览器查看这段代码的时候,显示效果正常,背景图片会正常的平铺容器,但是,你尝试缩小浏览器宽度的时候,尤其是宽度无法容下两个ul并列的时候,第二个ul会被挤到第二行,同时,背景图片也被挤到了第二个ul。

你会问到,一般我不会调整浏览器宽度啊,但是,如果你的容器的宽度不足,并且使用float属性,容器会被挤换行,这个BUG出现同样会出现。


解决方法


关于这个问题的解决方法,自己小小测试了一下,可以通过在每组相邻的两个ul之间,插入一个空白的段落<p></p>,或者插入一个&nbsp;,这样问题就解决了。但是加入空白的段落在IE6不知道为什么显示还有有问题,看来IE6只能插入一个可见字符了,比如&nbsp;。

模板制作小总结 - 文字容器随文字长度变化

发布时间:January 22, 2009分类:做做美工.Design
作者:HJin.me
评论: 6 条

模板已经做使用了2天了,使用的过程中,逐渐发现了一些小问题。这里把这些小问题总结一下。

首先不得不说让我心痛的IE,IE对图像的处理能力实在是让我头疼,虽然最后修改了定位的方式解决了页面底部草地的效果。这里说说问题所在。

先是IE给我带来的几个麻烦

第一是IE6的不支持PNG透明的问题,这个大家都知道,就不多说了,第二是关于background的问题。在页面底部先设置了草地图片的repeat,在正常的FF下面,我在其子容器里面放置图片啊,输入框啊,都不会影响底部草地图片,但是在IE6和IE7下,都出现了含图片(或input标签)的子容器挤走父容器的背景图片的情况。结果就导致父容器背景变成了空白,惨不忍睹啊。解决方法,我尚未详细测试和总结,我只是去掉了图像,去掉了部分block属性,以及包含图片(img标签)的容器不要使用float属性。当然,这个是不完整的总结。以后再测试测试这个bug的成因。

然后就说说标题中提到的“文本内容的背景随着文字长度扩展问题”

默认情况下,文本的属性是display:inline;,这样的属性,我们不能够给它设置width和height,甚至padding这个属性都会使该文本产生负偏移。起初使用的是postion:relative;来把负偏移抵消掉。但是这个效果在IE和FF下面显示效果出现了差异,尽量不要使用css hack吧。

第二种想法是使用display:block;来控制padding,这样虽然能够轻松调整文字位置,但是出现了标题中说的问题,块状对象的宽度不能够随着内部文字变化,这个明显不能够符合我最初设计的。

为了不用css hack,又要让容器宽度能够自适应,又一次请教了 Tension 之后,得知,可以直接使用float属性。在使用了float属性之后,这一段文字能够使用padding来调整其边距,并且容器的长宽能够随着文字的增减变化。简直是太完美了。而且这个代码在IE和FF下都显示正常,特别高兴啊!

具体效果就是主页的文章标题部分,大家可以使用firebug来分别测试这三种效果。

Microsoft 安全通报:4 种方法暂时屏蔽 IE 最新 0day

发布时间:December 14, 2008分类:软件技巧.Software
作者:HJin.me
评论: 2 条

我知道,访问我的网站的70%用户都是使用的IE核心的浏览器。而这次IE的严重漏洞却是覆盖了所有版本的windows下的所有版本的IE。为此,转载本文,给大家提醒。

IE 最新 0day 波及了微软全线系统,目前暂时没有补丁。微软于近日发布了一份安全通报,指导您如何暂时屏蔽此漏洞。

漏洞出在 OLEDB32.dll 这个文件上。所以我们的目的就是屏蔽这个文件。对此,微软连出了4个杀手锏:


1. SACL 法(仅适用于 Vista)


[Unicode]

Unicode=yes

[Version]

signature="$CHICAGO$"

Revision=1

[File Security]

"%ProgramFiles%Common FilesSystemOle DBoledb32.dll",2,"S:(ML;;NWNRNX;;;ME)"


将以上内容保存为 BlockAccess_x86.inf

然后在命令提示符里执行

SecEdit /configure /db BlockAccess.sdb /cfg <inf file>

其中 <inf file> 文件路径。若成功会看到“任务成功结束”的提示。


2. 禁用 Row Position 功能法


HKEY_CLASSES_ROOTCLSID{2048EEE6-7FA2-11D0-9E6A-00A0C9138C29}

打开注册表编辑器,将此键删除即可。


3. 取消 DLL 注册法


在命令提示符中输入 Regsvr32.exe /u "%ProgramFiles%Common FilesSystemOle DBoledb32.dll"

即可


4. 权限设置法


在命令提示符中输入


cacls "%ProgramFiles%Common FilesSystemOle DBoledb32.dll" /E /P everyone:N


Vista 系统则需要输入3个命令:


takeown /f "%ProgramFiles%Common FilesSystemOle DBoledb32.dll"

icacls "%ProgramFiles%Common FilesSystemOle DBoledb32.dll" /save %TEMP%oledb32.32.dll.TXT

icacls "%ProgramFiles%Common FilesSystemOle DBoledb32.dll" /deny everyone:(F)


其中第一种方法影响最小(只影响 IE 对此 DLL 的访问)。

附:此漏洞影响的系统、软件列表


  • Windows Internet Explorer 7
  • Windows Internet Explorer 7 for Windows XP
  • Windows Internet Explorer 7 for Windows Server 2003
  • Windows Internet Explorer 7 for Windows Server 2003 IA64
  • Windows Internet Explorer 7 in Windows Vista
  • Windows Internet Explorer 8 Beta
  • Microsoft Internet Explorer 6.0 Service Pack 2
  • Microsoft Internet Explorer 6.0 Service Pack 1
  • Microsoft Internet Explorer 6.0
  • Microsoft Internet Explorer 5.01 Service Pack 4
  • Windows Server 2008 Datacenter without Hyper-V
  • Windows Server 2008 Enterprise without Hyper-V
  • Windows Server 2008 for Itanium-Based Systems
  • Windows Server 2008 Standard without Hyper-V
  • Windows Server 2008 Datacenter
  • Windows Server 2008 Enterprise
  • Windows Server 2008 Standard
  • Windows Web Server 2008
  • Windows Vista Service Pack 1, when used with:
    • Windows Vista Business
    • Windows Vista Enterprise
    • Windows Vista Home Basic
    • Windows Vista Home Premium
    • Windows Vista Starter
    • Windows Vista Ultimate
    • Windows Vista Enterprise 64-bit Edition
    • Windows Vista Home Basic 64-bit Edition
    • Windows Vista Home Premium 64-bit Edition
    • Windows Vista Ultimate 64-bit Edition
    • Windows Vista Business 64-bit Edition
  • Microsoft Windows Server 2003 Service Pack 1, when used with:
    • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
    • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
    • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
    • Microsoft Windows Server 2003, Web Edition
    • Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems
    • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows Server 2003, Datacenter x64 Edition
  • Microsoft Windows Server 2003, Enterprise x64 Edition
  • Microsoft Windows Server 2003, Standard x64 Edition
  • Microsoft Windows XP Professional x64 Edition
  • Microsoft Windows Server 2003 Service Pack 2, when used with:
    • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
    • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
    • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
    • Microsoft Windows Server 2003, Web Edition
    • Microsoft Windows Server 2003, Datacenter x64 Edition
    • Microsoft Windows Server 2003, Enterprise x64 Edition
    • Microsoft Windows Server 2003, Standard x64 Edition
    • Microsoft Windows XP Professional x64 Edition
    • Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems
    • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows XP Service Pack 2, when used with:
    • Microsoft Windows XP Home Edition
    • Microsoft Windows XP Professional
  • Microsoft Windows XP Service Pack 3, when used with:
    • Microsoft Windows XP Home Edition
    • Microsoft Windows XP Professional

对于非 x86 系统请参考微软安全通报自行操作。

CSS hack区分IE6,7和FF

发布时间:November 1, 2008分类:做做美工.Design
作者:HJin.me
评论: 2 条

自己总结了一下自己在设计 CSS 过程中学会的和用过的 CSS hack 技术。相信看这篇文章的都不会是 CSS 白痴,所以 css 是层叠样式表我就不说了。

至于文中的 CSS hack 技术,要么是我从书上看到的,要么就是在学习别人的网站的 CSS 的时候发现的。


方法一:*和!important


IE都支持*,IE6 不支持 !important,firefox不支持 *

举例说明:


  1. color:#FFFFFF;/*FF显示的效果  */ 
  2. *color:#EE7EE7!important;/*IE7显示的效果  */ 
  3. *color:#EE6EE6;/*IE6显示的效果  */ 

叠放顺序必须如此,可以从中去掉某个。


方法二:+和-


IE7可以认+,IE6可以认-

举例说明:


  1. color:#FFFFFF;/*FF显示的效果  */   
  2. +color:#EE7EE7;/*IE7显示的效果  */   
  3. -color:#EE6EE6;/*IE6显示的效果  */   

方法三:居然是针对Firefox的 hack


Firefox对于 i 会转换成为 i ,所以对于width, heigh, margin 等包含字母 i 的参数都可以用这套方法。

举例说明:


  1. width:30px;/*非FF的显示效果*/ 
  2. width:25px;/*FF的显示效果*/ 

有了这三种方法,一般的 hack 问题都能够解决。学习和制作 CSS 中继续总结心得。