1

无论我做什么,标签标签都不会被我的 CSS 设置样式。

CSS:

label {
        font-family: 'Lucida Grande';
    }

HTML:

<div class="contact-form">
            <form action="post">
                <label for="name">Name:<input type="text" id="name" class="text" /></label>
                <label for="email">Email:<input type="text" id="email" class="text" /></label>
                <label for="message">Message:<textarea id="message"></textarea></label>
                <input type="submit" class="submit" value="Send Message" />
            </form>
        </div>

你猜怎么了?不是卢西达格兰德。

在这里行动:http: //christianselig.com/contact.html

4

1 回答 1

4

也许是因为reset.css压倒一切style.css

<!-- Stylesheets -->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/reset.css" rel="stylesheet" type="text/css" media="all" />

选择label器包含在此块的第 8 行中reset.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, 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,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0; 
    border: 0;
    font-size: 100%;
    font: inherit; 
    vertical-align: baseline;
}
于 2012-09-13T23:29:11.270 回答