2010-03-07 24 views
3

Universal Internet Explorer 6 CSS安迪·克拉克的 「通用Internet Explorer 6中的CSS」 與埃裏克邁耶 「CSS復位」

CSS代碼:

/* -------------------------------------------------------------- 
Standardised Internet Explorer 6 stylesheet: 
http://forabeautifulweb.com/blog/about/universal_internet_explorer_6_css/ 

Based on the work of: 
Mark Boulton: http://markboulton.co.uk 
Eric Meyer: http://meyerweb.com 
Cameron Moll: http://www.cameronmoll.com/ 
Richard Rutter: http://clagnut.com 
Khoi Vinh: http://subtraction.com 

-------------------------------------------------------------- */ 

html,   body, 
div,   span, 
object,   iframe, 
h1, h2, h3, h4, h5, h6, 
p,    blockquote, 
pre,   a, 
abbr,   acronym, 
address,  code, 
del,   dfn, 
em,    img, 
q,    dl, 
dt,    dd, 
ol,    ul, 
li,    fieldset, 
form,   label, 
legend,   table, 
caption,  tbody, 
tfoot,   thead, 
tr,    th, td { 
margin : 0; 
padding : 0; 
border : 0; 
font-weight : inherit; 
font-style : inherit; 
font-size : 100%; 
font-family : inherit; 
vertical-align : baseline; } 

/* Body ---------------------------------------------------- */ 

body { 
width : 60%; 

/* http://www.cameronmoll.com/archives/000892.html */ 
width : expression(document.body.clientWidth < 640? "640px" : document.body.clientWidth > 120? "120em" : "auto"); 
margin : 0 auto; 
padding : 2em 0; 
background : #fff; 
font : 88% Georgia, Times, serif; 
line-height : 1.4; 
color : #333; } 

/* Headings ---------------------------------------------------- */ 

h1, h2, h3, h4, h5, h6 { 
font-weight : normal; } 

h1 { 
margin-bottom : .5em; 
font-size : 3em; 
line-height : 1; } 

h2 { 
margin-bottom : .75em; 
font-size : 2em; } 

h3 { 
margin-bottom : 1em; 
font-size : 1.5em; 
line-height : 1 ; } 

h4 { 
margin-bottom : 1.25em; 
font-size : 1.2em; 
line-height : 1.25; } 

h5, h6 { 
margin-bottom : 1.5em; 
font-weight : bold; 
font-size : 1em; } 

h1 img, h2 img, h3 img, h4 img, h5 img, h6 img { 
margin : 0; } 

/* Text elements -------------------------------------------------------------- */ 

p { 
margin : 0 0 1.5em; } 

a { 
color : #105cb6; 
text-decoration : underline; } 

a:visited { 
color : #105cb6; } 

a:focus, a:hover { 
color : #003; } 

a img { 
border : none; } 

blockquote, q { 
quotes : "" ""; } 

blockquote { 
margin : 1.5em 1.5em 1.5em -1.5em; 
padding-left : 1.5em; 
border-left : 1px solid #666; 
font : italic 1.2em "Times New Roman", Times, serif; } 

blockquote:before, blockquote:after, q:before, q:after { 
content : ""; } 

strong { 
font-weight : bold; } 

em, dfn { 
font-style : italic; } 

dfn { 
font-weight : bold; } 

sup, sub { 
line-height : 0; } 

abbr, acronym { 
border-bottom : 1px dotted #666; } 

address { 
margin : 0 0 1.5em; 
font-style : italic; } 

del { 
color : #666; } 

pre, code, tt { 
margin : 1.5em 1.5em 1.5em -1.5em; 
padding-left : 1.5em; 
border-left : 1px dotted #666; 
font : 1em 'andale mono', 'lucida console', monospace; 
line-height : 1.5; } 

pre { 
white-space : pre; } 

code { 
display : block; } 


/* Lists -------------------------------------------------------------- */ 

li ul, li ol { 
list-style-type : circle; 
margin : 0 1.5em .75em 1.5em; } 

ul, ol { 
margin : 0 1.5em 1.5em 0; } 

ul { 
list-style-type : disc; } 

ol { 
list-style-type : decimal; } 

dl { 
margin-bottom: 1.5em; 
padding-top: 1.5em; 
border-top : 1px solid #ccc; } 

dl dt { 
margin-bottom : .75em; 
font-size : 1.2em; 
line-height : 1.25; } 

dd { 
margin-bottom: 1.5em; 
padding-bottom: 1.5em; 
border-bottom : 1px solid #ccc; } 

/* Tables -------------------------------------------------------------- */ 

table { 
border-collapse : separate; 
border-spacing : 0; 
margin-bottom : 1.4em; 
width : 100%; } 

table, td, th { 
vertical-align : top; } 

th, thead th { 
font-weight : bold; } 

th, td, caption { 
padding : 4px 10px 4px 5px; 
text-align : left; 
font-weight : normal; } 

th, td { 
border-bottom : 1px solid #ccc; } 

tfoot { 
font-size : .9em; } 

caption { 
margin-bottom : 1em; 
font-size : 1.5em; 
line-height : 1 ; } 

/* Forms -------------------------------------------------------------- */ 

label { 
font-weight : bold; } 

fieldset { 
margin : 0 0 1.5em 0; 
padding : 1.4em 1.4em 0 1.4em; 
border : 1px solid #ccc; } 

legend { 
font-size : 1.2em; 
font-weight : bold; } 

textarea { 
width : 390px; 
height : 250px; 
padding : 5px; } 

埃裏克邁耶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, 
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-weight: inherit; 
    font-style: inherit; 
    font-size: 100%; 
    font-family: inherit; 
    vertical-align: baseline; 
} 
/* remember to define focus styles! */ 
:focus { 
    outline: 0; 
} 
body { 
    line-height: 1; 
    color: black; 
    background: white; 
} 
ol, ul { 
    list-style: none; 
} 
/* tables still need 'cellspacing="0"' in the markup */ 
table { 
    border-collapse: separate; 
    border-spacing: 0; 
} 
caption, th, td { 
    text-align: left; 
    font-weight: normal; 
} 
blockquote:before, blockquote:after, 
q:before, q:after { 
    content: ""; 
} 
blockquote, q { 
    quotes: "" ""; 
} 
  1. 如果我正在製作一個需要在IE 6上兼容的網站母雞 我應該使用通用IE6 CSS隨着eric meyer css重置或沒有需要或利益使用通用IE6 CSS?
  2. 或我應該同時使用但通用 Internet Explorer 6 CSS只適用於 IE6,我的意思是在條件註釋。
  3. 或我應該使用兩個作爲正常的css 沒有條件註釋的IE6?

如果我應該使用兩個,那麼應該是什麼順序來放置。哪一個應該首先來源?

+2

這是偏好的問題,而不是一個編程問題。這可能屬於doctype.com – 2010-03-07 11:18:06

回答

2

通用Internet Explorer 6 CSS是而不是重置CSS。它不打算與所有瀏覽器一起使用。

這是一個樣式表,它爲您提供了純文本版本的網站。其目的是在IE6中提供一個可用的網站,而不必花費時間使其看起來與其他瀏覽器相同。

看到這個網站:Universal Internet Explorer 6 CSS home page

this is what that site looks like in IE6

+0

哦謝謝澄清。 – 2010-03-07 13:17:55

0

我對Andy Clarke的樣式表並不熟悉,但看起來它只是和Eric Meyer做同樣的重置工作,然後放入一些特定的默認樣式。對於IE 6沒有什麼特別的幫助(儘管不是沒有幫助)。

我不認爲他們中的任何一個都對IE 6兼容性特別有幫助。通過擺脫大多數默認瀏覽器樣式,CSS重置可以爲您提供幾乎完全乾淨的平板。

我覺得這很有幫助,因爲它會強制你思考所有的樣式,並且可以節省很多重置整個樣式表的工作,例如,如果你經常使用列表來表示不應該有默認瀏覽器列表的東西樣式。但是解決Internet Explorer的錯誤和缺少的功能並沒有太大的區別。

+0

我知道CSS重置不是IE瀏覽器的解決方案,但它有助於重置樣式,因此使用重置修復了包括IE在內的所有瀏覽器中的一些不一致之處。那麼對於IE而言,我們需要在CSS中做一些更改 – 2010-03-07 12:19:18

+0

另一種想法是,如果您將不得不將所有樣式設置爲有價值,則不需要重置這些重置,因爲您將它們全部重置爲「零」,然後重置他們再次達到你想要的價值。首先將它們設置爲你想要的,並忽略任何初始重置。 – Rob 2010-03-07 12:41:36

+0

@Paul D. Waite,@ Rob - Universal IE6 CSS的用途和優點是什麼? – 2010-03-07 12:47:22

0

就我個人而言,我用CSS重置所有的方式。就類比而言,我認爲它與創建其畫布框架並應用空白畫布的藝術家相同。

我從來沒有成爲Universal IE6 CSS的粉絲,因爲它似乎有點反直覺,我重置每個元素,然後將其他默認值的整個負載應用到頁面。

我的方法一直是:重置每個元素(使用CSS Reset)並從頭開始,稍後您可能需要IE6特定的CSS,但從我自己的經驗來看,它通常不會超過4或5個元素,一個IE6條件CSS文件。