[英]HTML5 & CSS3: How can I make sure that my code is compatible to all browsers?
Whenever I am working with webdesign every browsers shows something different which ruins the layout. 每当我使用网页设计时,每个浏览器都会显示不同的东西,这会破坏布局。 Is there any tools or guidelines to make a webdesign without any problems?
是否有任何工具或指南可以毫无问题地进行网页设计?
Thanks in advance! 提前致谢!
There are a lot of different tools and technologies that can help make this better/easier but nothing beats good old cross-browser testing. 有许多不同的工具和技术可以帮助使这更好/更容易,但没有什么比旧的跨浏览器测试更好。 Here are some tools you might like:
以下是您可能喜欢的一些工具:
I don't think that all designs must look the same in all browsers. 我不认为所有设计在所有浏览器中看起来都一样。 It's nearly impossible with the growing range of browsers and devices that must be supported, but I understand that things shouldn't break.
随着越来越多的浏览器和设备必须得到支持,这几乎是不可能的,但我知道事情不应该破坏。
This might require a case-to-case basis, but some things to look into are: 这可能需要个案基础,但有些事情需要研究:
显然你必须为每种特定类型的浏览器调整设计。
使用CSS框架(如http://twitter.github.com/bootstrap/或http://documentcloud.github.com/backbone/)肯定可以帮助完成此过程。
Grab Modernizr for a start, which uses selectivizr I believe! 抓住Modernizr开始,我相信使用选择性 !
For Li's I would use 对于李,我会用
li{
display: inline-block; //NO Floats
*display: inline; /* < target IE7 */
*zoom:1;
}
Double margins: fix those with IE conditional stylesheet OR html5boilerplate 双边距:用IE条件样式表或html5boilerplate修复
Most other elements would depend on display
type 大多数其他元素将取决于
display
类型
For CSS3 maybe use CSSPie 对于CSS3,也许可以使用CSSPie
Clears: 清除:
:after{
content: '.';
clear:both;
visibility: hidden;
*zoom:1;
height:0;
display:block;
}
Some of the other issue's are fixed quite easily! 其他一些问题很容易修复!
For screen width's use % instead of PX for greater control 对于屏幕宽度,使用%代替PX以获得更好的控制
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.