html测试兼容的网站,html+css网站的兼容性测试及解决方法(Compatibility testing and solution of html+css website).doc...

本文介绍了HTML+CSS网站在不同浏览器(如IE6-IE10、Firefox等)之间的兼容性测试方法,并提供了遵循W3C标准的验证手段。同时,详细讲解了如何通过CSS hack来解决浏览器兼容性问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

htmlcss网站的兼容性测试及解决方法(Compatibilitytestingandsolutionofhtmlcsswebsite)

html+css网站的兼容性测试及解决方法(Compatibility testing and solution of html+css website)

Compatibility testing of web pages

1, check compatibility between browsers

IE6-IE10, Firefox, et al

2. Verify compliance with W3C standards

You can use some of the following methods for testing.

1, Dreamweaver

2, validator.w3.org officially conducts online verification

Solving browser compatibility issues

For different browsers, write the corresponding CSS style code, so that browsers only explain themselves can identify CSS style code. These style codes are called "CSS hack"".

The idea of writing CSS hack is to prepare CSS style code for each browser according to the special symbol of the browser "identification".

CSS hack mode for mainstream browsers

Firefox does not support special symbols. "Important!""

After the IE8 \0 statement, before the semicolon. Such as: padding:5px; padding:0px\0;

IE7 + statement or label before. Such as: p{width:55px}; +p{width:60px;}

IE6 _ + statement or tag. Such as: width:80px; _width:60px;

Example:

#mydiv{

Padding:5px; /*firefox*/

Padding:10px\0; /*IE8*/

+padding:15px; /*IE7*/

_padding:20px; /*IE6*/

}

* the order of writing is usually Firefox first, then IE8, or IE7, and IE6 must be last.

If statements supported by various versions of IE

IE6 < < --[if IE 6.0]>IE6 HTML code < < [endif]-->

IE7 < < --[if IE 7.0]>IE7 HTML code < < [endif]-->

IE8 < < --[if IE 8.0]>IE8 HTML code < < [endif]-->

concrete problems

1, three pixel text slow down problem

Scene: IE6, followed by an inline element after the floating (float) element, there is a gap of 3 pixels between the two.

Solution: set the inline element for IE6 separately: _margin-left:-3px;"

Note that if you do not declare that the document type is XHTML, Transitional, or Strict, all IE versions will have this bug.

The code reads as follows:

solves IE6's 3 pixel slow shift bug

Body{margin:0px; padding:0px; font-size:13px;}

#container{width:400px; height:150px; background:yello

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值