如何在.net中设置浏览器兼容性 [英] how to set browser compatability in .net

查看:289
本文介绍了如何在.net中设置浏览器兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在.net中设置浏览器.我最近建立了一个网站.当我检查不同的浏览器时,对齐方式正在改变.我该怎么办才能解决此问题

hi ,

how can i set browser in .net. i have developed a website resently.when i check i different browsers the alignment is changing. what can i do to set this problem

推荐答案

使用% 表示宽度而不是px.
就像
Use % for width instead of px.
like
<div style="Width:50%"></div>


很难在所有浏览器中使网站看起来完全一样. (特别是,Microsoft搞砸了各种CSS布局属性,例如最小宽度,边距/填充等,因此要使页面在IE中正确显示需要黑客.)您应该担心的是,该网站看起来在所有(主要)浏览器中.

可以使用一些CSS技巧来欺骗不同的浏览器来解析样式表的不同位,检测浏览器服务器端并发出不同的样式信息,或者简单地接受问题,避免使用问题属性/样式属性有些项目会移动一些并使用相对位置,以便使事物在其本地上下文中处于正确的位置.

搜索浏览器兼容性CSS 应该会为您提供一些有关如何使布局尽可能接近地工作的有用信息.
Getting websites to look exactly the same in all browsers is difficult. (In particular, Microsoft screw up various CSS layout properties, like min-width, margin/padding etc, so to get a page to look right in IE requires hackery.) What you should be worried about is the site looking good in all (major) browsers.

That can be a matter of staying away from the problem attributes/style properties, using some of the CSS tricks to fool different browsers into parsing different bits of your stylesheet, detecting the browser server-side and emitting different style information, or simply accepting that some items will move a bit and using relative positions so that things are in the right place within their local context.

Searching for browser compatibility CSS should get you some useful information on how to make layout work as close to the same as possible.


以下是一些提示,请参考,
http://techbrij.com/80/7-tips-to-使您的网站跨浏览器兼容 [ ^ ]
Here are some tips refer,
http://techbrij.com/80/7-tips-to-make-your-website-cross-browser-compatible[^]


这篇关于如何在.net中设置浏览器兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆