-1

在此处输入图像描述

<form className="pure-form">
    <fieldset>
         <input ref="email" type="email" placeholder="Email" 
                  value={this.state.emailInput} 
                  onChange={this.handleChange}
                   />
         <input ref="password" type="password" placeholder="Password" 
                        value={this.state.passwordInput} 
                        onChange={this.handleChange} 
                        />

        <label htmlFor="remember">
            <input ref="remember" id="remember" type="checkbox" /> Remember me?
        </label>

        <button onClick={this.handleLoginClick} type="submit" className="pure-button pure-button-primary">Sign in</button>
    </fieldset>
</form>

我只是从 Purecss.io 复制粘贴了示例表单。怎么一切都粘在一起了?为什么他们没有保证金?

4

2 回答 2

2

您错误地添加了类:

<form className="pure-form">

应该

<form class="pure-form">

...等等。

<link href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css" rel="stylesheet" />
<form class="pure-form">
  <fieldset>
    <input red="email" type="email" placeholder="Email" />
    <input ref="password" type="password" placeholder="Password" />

    <label htmlFor="remember">
      <input ref="remember" id="remember" type="checkbox" />Remember me?
    </label>

    <button onClick={this.handleLoginClick} type="submit" class="pure-button pure-button-primary">Sign in</button>
  </fieldset>
</form>

于 2015-10-13T10:03:09.413 回答
0

如果你想在任何 html 标签上调用任何 css 类,Paulie_D 是正确的,那么你需要遵循这样的语法

<tag class="classname"></tag>

    Eg:

    <form class="pure-form">
    form elements goes here 
    </form>
于 2015-10-13T10:13:05.723 回答