开发者

making site rendering compatible with all browser only depend on CSS or X/HTML has any role?

开发者 https://www.devze.com 2022-12-20 07:15 出处:网络
If CSS 开发者_Go百科is only factor then What thing in css should be in our habit to make site compatible in All A grader browser.

If CSS 开发者_Go百科is only factor then What thing in css should be in our habit to make site compatible in All A grader browser.

Firefox, Safari, IE 6, IE 7, IE 8

Can we avoid the need of Conditional CSS for IE?


There are going to be cases where some browsers don't behave according to W3C standards. In the case of IE, conditional comments allows for the neat encapsulation of CSS intended only for these browsers.

I don't think it would be desirable to avoid using conditional-comments, because the alternative involves using hacks to target a specific browser. Hacks (such as the 'star hack') could be non-functional in the future, and can't be relied upon.

A CSS reset script is very useful, because it creates a default starting point for your custom CSS.

Even though use of a resets script is likely to help iron out a lot of inconsistencies between browsers, it won't remove the need for specific CSS intended solely for IE6 or IE7.


I'm not sure what "thing" you want in terms of CSS to achieve cross-browser compatibility, but it is certainly possible to achieve it without IE conditional tags. If I have to use those, I can't help feeling that I have failed.


Yes, it depends on the complexity.

If you want a helping hand you could use a CSS Reset... This makes it alot more easy avoiding Conditional CSS.

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; }
body { line-height: 1; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
:focus { outline: 0; }
ins { text-decoration: none; }
del { text-decoration: line-through; }
table { border-collapse: collapse; border-spacing: 0; }
0

精彩评论

暂无评论...
验证码 换一张
取 消