[英]How do I ensure my website or web app based on html works on all browsers properly
我想知道我是否需要在html文件中进行一种方式或设置,以便我的asp.net网站/ html网站在所有浏览器(IE / Firefox / Opera)中正确的长度/高度尺寸正常工作...等等......设置和我需要做的事情是什么?
Go to the Test Center at http://crossbrowsertesting.com/user and run live tests. 访问http://crossbrowsertesting.com/user上的测试中心并运行实时测试。 You'll have options for multiple browsers and versions.
您可以选择多个浏览器和版本。
There really isn't one way to check all browser compatibilities... 确实没有一种方法可以检查所有浏览器的兼容性......
The main problem with this is that each browser uses its own variation of the CSS3 standards. 这个问题的主要问题是每个浏览器都使用自己的CSS3标准变体。 Gecko and webkit browsers seem to be fairly consistent, but IE usually throws a wrench in the gears, especially between versions.
Gecko和webkit浏览器似乎相当一致,但是IE通常会在齿轮中引起轰动,特别是在版本之间。
In all honesty, you are best making sure you comply with the standards and include browser engine specific styles to target each browser. 老实说,您最好确保符合标准并包含针对每个浏览器的浏览器引擎特定样式。
For instance, if you are setting the background and you wish to have a CSS styled gradient, you may need to do something like this: 例如,如果您要设置背景并希望拥有CSS样式渐变,则可能需要执行以下操作:
.gradient-bg {
background: #ececed;
background: -moz-linear-gradient(top, #ececed 0%, #fefefe 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ececed), color-stop(100%,#fefefe));
background: -webkit-linear-gradient(top, #ececed 0%,#fefefe 100%);
background: -o-linear-gradient(top, #ececed 0%,#fefefe 100%);
background: -ms-linear-gradient(top, #ececed 0%,#fefefe 100%);
background: linear-gradient(top, #ececed 0%,#fefefe 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ececed', endColorstr='#fefefe',GradientType=0 );
}
This ensures that we address legacy browsers that don't support any gradient transformations, as well as various versions that do support but in different ways (ie -ms-linear-gradient vs. filer: progid:DXImageTransform.Microsoft.gradient or -webkit-gradient vs. -webkit-linear-gradient). 这确保我们解决不支持任何梯度转换的旧版浏览器,以及支持但以不同方式支持的各种版本(即-ms-linear-gradient与filer:progid:DXImageTransform.Microsoft.gradient或-webkit -gradient vs. -webkit-linear-gradient)。 Also note that any CSS attribute that is not recognized by the browser is simply ignored and the browser's rendering falls to the next recognized style variant.
另请注意,浏览器无法识别的任何CSS属性都会被忽略,浏览器的渲染属于下一个已识别的样式变体。
It is becoming more and more industry standard that you develop for CSS3 and let unorthodox browsers render unorthodoxically. 它为CSS3开发越来越多的行业标准,让非正统的浏览器呈现非正统的。
The only way to be truly sure is to check it in each supported browser and see for yourself. 真正确定的唯一方法是在每个支持的浏览器中检查它并亲自查看。 Also be aware, though, that while IE comes with developer tools that allow you to view your content rendered as if in previous versions of IE, it still may be drastically different from the actual (non-compatibility view) version.
另外请注意,虽然IE附带的开发人员工具允许您查看您在IE的早期版本中呈现的内容,但它仍然可能与实际(非兼容性视图)版本截然不同。
Easiest way to get IE to render the same (or close to it) across various version numbers is to force compatibility through a META tag. 使IE在各种版本号上呈现相同(或接近它)的最简单方法是通过META标记强制兼容。 ( renders in IE7 mode and supports DOCTYPE directive).
(在IE7模式下呈现并支持DOCTYPE指令)。
Long story short... try to stick to standards to make webkit & gecko compatible, then address IE issues as you stumble upon them. 长话短说...尝试坚持标准,使webkit和gecko兼容,然后在发现它们时解决IE问题。 Since IE is about the only browser not in the other 2 categories, you should be good.
由于IE是唯一不属于其他两个类别的浏览器,因此您应该做得很好。
使用允许您在Adobe Browser Lab等多种浏览器中查看页面的服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.