具有相同类的2个输入具有不同的外观(HTML)

时间:2016-11-25 13:32:34

标签: html html5

我制作了一个带有两个相同类输入的表单,但它们有不同的外观。如果我将类型从“email”更改为“text”,它们只会出现相同的外观。它是代码的问题还是HTML5呢?

<form action="../../../redirect.html">
<input name="username" id="login-username" class="login-input pure-u-1" type="email" maxlength="96" tabindex="1" aria-required="true" value="" placeholder="Indtast din e-mail" title="Indtast din e-mail" autocorrect="off" spellcheck="false" required autofocus>

<input name="password" id="login-password" class="login-input pure-u-1" type="password" maxlength="96" tabindex="1" aria-required="true" value="" placeholder="Indtast din adgangskode" title="Indtast din adgangskode" autocorrect="off" spellcheck="false" required>
<button type="submit" formaction="../../../redirect.html" id="login-signing" class="pure-u-1 pure-button mbr-button-primary" value="Submit" tabindex="1">Login</button>
</form>

1 个答案:

答案 0 :(得分:0)

在你的css file中,它似乎是具有类&#34;纯粹形式&#34;的样式输入。但你已经使用了&#34; login-input&#34;。所以似乎问题在于如何使用你的CSS风格而不是关于&#34; HTML5&#34;。

这是正确的代码:

<form action="../../../redirect.html">
<input name="username" id="login-username" class="pure-form pure-u-1" type="email" maxlength="96" tabindex="1" aria-required="true" value="" placeholder="Indtast din e-mail" title="Indtast din e-mail" autocorrect="off" spellcheck="false" required autofocus>

<input name="password" id="login-password" class="pure-form pure-u-1" type="password" maxlength="96" tabindex="1" aria-required="true" value="" placeholder="Indtast din adgangskode" title="Indtast din adgangskode" autocorrect="off" spellcheck="false" required>
<button type="submit" formaction="../../../redirect.html" id="login-signing" class="pure-u-1 pure-button mbr-button-primary" value="Submit" tabindex="1">Login</button>
</form>