Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html lang="ja">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>
    Users </title>
  <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
</head>

<body>

  <nav class="navbar navbar-default navbar-static-top">
    <div class="container">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">ダッシュ</a>
      </div>

      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
          <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
        </ul>
        <form class="navbar-form navbar-right" role="search">
          <div class="form-group">
            <input type="text" class="form-control" placeholder="Search">
          </div>
        </form>
        <ul class="nav navbar-nav navbar-right">
          
          <li><a href="/users/logout">ログアウト</a></li>

        </ul>
      </div>
      <!-- /.navbar-collapse -->
    </div>
    <!-- /.container-fluid -->
  </nav>


  <div class="container">
    <div class="row">
      <div class="alert alert-danger">
        <a class="close" data-dismiss="alert" href="#">×</a> The user could not be saved. Please, try again.</div>
      <h1>Add User</h1>
      <form action="/users/add" class="well form-horizontal" id="UserAddForm" method="post" accept-charset="utf-8">
        <div style="display:none;">
          <input type="hidden" name="_method" value="POST" />
        </div>
        <fieldset>
          <legend>Fields</legend>
          <div class="form-group required">
            <label for="UserUsername" class="col col-md-3 col-sm-4 control-label">Username</label>
            <div class="col col-md-9 col-sm-8 required">
              <input name="data[User][username]" class="form-control" maxlength="128" type="text" value="hoge@example.com" id="UserUsername" required="required" />
            </div>
          </div>
          <div class="form-group required has-error error">
            <label for="UserPassword" class="col col-md-3 col-sm-4 control-label">Password</label>
            <div class="col col-md-9 col-sm-8 required">
              <input name="data[User][password]" class="form-control form-error" type="password" value="sd" id="UserPassword" required="required" /><span class="help-block text-danger">パスワードは6文字以上、32文字以内で入力してください</span></div>
          </div>
          <div class="form-group required">
            <label for="UserGroupId" class="col col-md-3 col-sm-4 control-label">Group</label>
            <div class="col col-md-9 col-sm-8 required">
              <select name="data[User][group_id]" class="form-control" id="UserGroupId" required="required">
                <option value="1" selected="selected">Administrator</option>
                <option value="2">Customer</option>
              </select>
            </div>
          </div>
          <div class="form-group required">
            <div class="required">
              <label for="UserLastName" class="col col-md-3 col-sm-4 col-xs-12 control-label">お名前</label>
              <div class="col col-md-3 col-sm-4 col-xs-6 required">
                <input name="data[User][last_name]" class="form-control" placeholder="姓" maxlength="64" type="text" value="田中" id="UserLastName" required="required" />
              </div>
            </div>
            <label for="UserFirstName" class="sr-only">First Name</label>
            <div class="col col-md-3 col-sm-4 col-xs-6 required">
              <input name="data[User][first_name]" class="form-control" placeholder="名" maxlength="64" type="text" value="明子" id="UserFirstName" required="required" />
            </div>
          </div>
          <div class="form-group required has-error error">
            <div class="required has-error error">
              <label for="UserLastNameKana" class="col col-md-3 col-sm-4 col-xs-12 control-label">フリガナ</label>
              <div class="col col-md-3 col-sm-4 col-xs-6 required">
                <input name="data[User][last_name_kana]" class="form-control form-error" placeholder="セイ" maxlength="64" type="text" value="たなか" id="UserLastNameKana" required="required" /><span class="help-block text-danger">カタカナで入力してください</span></div>
            </div>
            <label for="UserFirstNameKana" class="sr-only">First Name Kana</label>
            <div class="col col-md-3 col-sm-4 col-xs-6 required">
              <input name="data[User][first_name_kana]" class="form-control form-error" placeholder="メイ" maxlength="64" type="text" value="あきこ" id="UserFirstNameKana" required="required" /><span class="help-block text-danger">カタカナで入力してください</span></div>
          </div>
          <div class="form-group required has-error error">
            <div class="required has-error error">
              <label for="UserZipCode1" class="col col-md-3 col-sm-4 col-xs-12 control-label">郵便番号</label>
              <div class="col col-md-2 col-sm-2 col-xs-3 required">
                <input name="data[User][zip_code1]" class="form-control form-error" placeholder="000" maxlength="3" type="text" value="02" id="UserZipCode1" required="required" /><span class="help-block text-danger">数字3桁</span></div>
            </div>
            <label for="UserZipCode2" class="sr-only">Zip Code2</label>
            <div class="col col-md-2 col-sm-2 col-xs-4 add-hyphen required">
              <input name="data[User][zip_code2]" class="form-control form-error" placeholder="0000" maxlength="4" type="text" value="002" id="UserZipCode2" required="required" /><span class="help-block text-danger">数字4桁</span></div>
          </div>
          <div class="form-group required">
            <label for="UserPref" class="col col-md-3 col-sm-4 control-label">Pref</label>
            <div class="col col-md-9 col-sm-8 required">
              <input name="data[User][pref]" class="form-control" maxlength="8" type="text" value="hoge" id="UserPref" required="required" />
            </div>
          </div>
          <div class="form-group required">
            <label for="UserAddress1" class="col col-md-3 col-sm-4 control-label">Address1</label>
            <div class="col col-md-9 col-sm-8 required">
              <input name="data[User][address1]" class="form-control" maxlength="128" type="text" value="hoge" id="UserAddress1" required="required" />
            </div>
          </div>
          <div class="form-group required">
            <label for="UserAddress2" class="col col-md-3 col-sm-4 control-label">Address2</label>
            <div class="col col-md-9 col-sm-8 required">
              <input name="data[User][address2]" class="form-control" maxlength="128" type="text" value="0-00-00" id="UserAddress2" required="required" />
            </div>
          </div>
          <div class="form-group">
            <label for="UserAddress3" class="col col-md-3 col-sm-4 control-label">Address3</label>
            <div class="col col-md-9 col-sm-8">
              <input name="data[User][address3]" class="form-control" maxlength="128" type="text" value="hoge" id="UserAddress3" />
            </div>
          </div>
          <div class="form-group required has-error error">
            <label for="UserTel" class="col col-md-3 col-sm-4 control-label">Tel</label>
            <div class="col col-md-9 col-sm-8 required">
              <input name="data[User][tel]" class="form-control form-error" maxlength="16" type="tel" value="hoge-123-123" id="UserTel" required="required" /><span class="help-block text-danger">電話番号の形式が正しくありません</span></div>
          </div>
        </fieldset>
        <div class="form-group">
          <div class="col col-md-9 col-md-offset-3 col-sm-8 col-sm-offset-4">
            <input class="btn btn-primary btn-lg" type="submit" value="Submit" />
          </div>
        </div>
      </form>
    </div>
  </div>


  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>

</html>
              
            
!

CSS

              
                @charset "UTF-8";
body,
p,
th,
td,
input,
button,
select,
textarea {
  font-family: "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", Osaka, sans-serif
}

form .required label:after {
  border-radius: 0.25em;
  color: #fff;
  display: inline;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  padding: 0.1em 0.5em;
  margin-left: 0.7em;
  text-align: center;
  vertical-align: baseline;
  white-space: nowrap;
  background-color: #d9534f;
  content: '必須'
}

.add-hyphen:before {
  content: '-';
  display: block;
  position: absolute;
  top: 0.3em;
  left: -0.3em
}
              
            
!

JS

              
                
              
            
!
999px

Console