2011-02-07 85 views
0

它看起來像firefox和鉻默認文本輸入到一個fieldset集中,但默認它離開?我怎樣才能使所有的文本框輸入左對齊?我怎樣才能讓IE,Firefox,Chrome對齊輸入文本框?

+0

你應該發佈一些代碼或鏈接到一個例子,以便我們可以看到你的問題。我不記得之前默認居中對齊的文本字段。 – 2011-02-07 04:03:58

回答

3

使用瀏覽器重置。將以下內容粘貼爲FIRST css,因此請將其放在一個名爲reset.css的文件中,並將其包含在頭部的頂部,或將其粘貼到任何其他css之前。

(從http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/

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: "" ""; 
} 
0

我不是很肯定在這裏,但CSS是不是JavaScript更相似的方式進行解釋。試試CSS。