Doe J. Doe J. - 10 days ago 7
HTML Question

2 inputs with same classes have different appearances (HTML)

I have made a form with two inputs with the same classes but they have different appearances. They only get the same appearances if I change the type from "email" to "text". Is it a problem with the code or is it HTML5 that does it?



<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>




Answer

in your css file, it seems that it style input's that has class "pure-form" but you have used "login-input". so it seem's that the problem is about how to use your css style not about "HTML5".

this is the correct code:

<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>
Comments