2011-02-07 78 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。

相关问题