Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Lovecode_Form 作業</title>
    <link rel="stylesheet" href="reset.css" />
    <link rel="stylesheet" href="form.css" />
    <link
      href="https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css"
      rel="stylesheet"
    />
  </head>
  <body>
    <div class="nav">
      <img src="https://picsum.photos/100/40/?random=10" />
    </div>
    <div class="wrap">
      <div class="aside">
        <ul>
          <li>
            <a href=""><i class="bx bx-home"></i>Dashboard</a>
          </li>
          <li>
            <a href="" class="active"><i class="bx bxs-cuboid"></i>Products</a>
          </li>
          <li>
            <a href=""><i class="bx bxs-report"></i>Reports</a>
          </li>
          <li>
            <a href=""><i class="bx bx-folder"></i>Documents</a>
          </li>
        </ul>
      </div>
      <div class="container">
        <div class="title">
          <div class="path">
            <ul>
              <li><a href="">Dashboard</a></li>
              <li><a href="">Products</a></li>
              <li><a href="">New Product</a></li>
            </ul>
          </div>
        </div>
        <form action="/add-product" class="form">
          <div class="form-title">
            <h2>New Product</h2>
          </div>
          <div class="box nametext">
            <label for="name" class="label" name="productname">商品名稱</label>
            <input
              type="text"
              id="name"
              placeholder="e.g.ABC Shoes"
              autofocus
            />
          </div>
          <div class="box typeselect">
            <label for="choice" class="label">商品種類</label>
            <select id="choice" name="choice" aria-placeholder="Select">
              <option value="jac">上衣</option>
              <option value="coat">外套</option>
              <option value="pant">褲子</option>
              <option value="acc">配件</option>
            </select>
          </div>
          <div class="box skutext">
            <label for="sku" class="label">SKU</label>
            <input type="text" id="sku" valeu="sku" placeholder="e.g.ABC-123" />
          </div>
          <div class="box typeradio">
            <p class="label">商品類別</p>
            <input type="radio" name="sex" value="male" class="sex" />男裝
            <input type="radio" name="sex" value="female" class="sex" />女裝
          </div>
          <div class="box pritext">
            <label for="pri" class="label">商品單價(NTD)</label>
            <input type="number" id="pri" value="pri" placeholder="$1,000" />
          </div>
          <div class="box check">
            <div class="item">
              <input
                type="checkbox"
                class="checkbox"
                name="return"
                value="return"
              />可退貨
            </div>
            <div class="item">
              <input
                type="checkbox"
                class="checkbox"
                name="delivery"
                value="delivery"
              />免運
            </div>
          </div>
          <div class="box profile">
            <label for="file" class="label">上傳商品圖</label>
            <input type="file" id="file" name="profile" />
          </div>
          <div class="button-group">
            <input type="button" class="backbut" name="backbut" value="返回" />
            <input type="submit" class="button" name="submit" value="新增" />
          </div>
        </form>
      </div>
    </div>
  </body>
</html>

              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100;300;400;500;700&display=swap");
* {
  margin: 0;
  padding: 0;
  list-style: none;
  box-sizing: border-box;
}
body {
  font-family: "Noto Sans TC", sans-serif;
  background-color: #eee;
  color: #566b7a;
}
.nav {
  height: 60px;
  background-color: #fff;
  border-bottom: 1px solid #aaa;
  width: 100%;
}
.nav img {
  display: inline-block;
  vertical-align: middle;
  padding: 10px 30px;
}
.wrap {
  width: 1400px;
  display: flex;
}
.aside {
  height: 100vh;
  width: 15%;
  box-shadow: 10px 0 50px #dbdbdb;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.aside ul {
  padding: 20px 0;
}
.aside .bx {
  padding: 0 10px 0;
}
.aside li a {
  text-decoration: none;
  line-height: 2.5rem;
  color: #566b7a;
  font-weight: 500;
}
.aside .active {
  color: #fb834c;
}
.aside li a:hover:not(.active) {
  color: #fb834c;
}
.title {
  padding: 20px;
}
.title ul {
  display: flex;
  padding: 20px;
}
.title li a {
  text-decoration: none;
  color: #566b7a;
  font-size: 13px;
  padding: 0 10px;
}
.title li a:hover {
  color: #fb834c;
}
.title li + li::before {
  content: "/";
  color: #566b7a;
  font-size: 13px;
}
.form {
  margin: 0 50px;
  background-color: #fff;
  border: 1px solid #fff;
  border-radius: 10px;
  font-family: "Noto Sans TC", sans-serif;
  width: 100vh;
}
.form-title {
  display: flex;
  justify-content: space-between;
  height: 60px;
  border-bottom: 1px solid #eee;
  margin: 10px;
}

.form-title h2 {
  font-weight: 700;
  padding-left: 10px;
  line-height: 60px;
}
.button-group {
  padding: 0 10px;
  margin: 10px;
}
.backbut {
  display: inline-block;
  line-height: 40px;
  width: 80px;
  height: 40px;
  text-align: center;
  color: #fff;
  border: 2px solid #aaa;
  border-radius: 4px;
  background-color: #aaa;
  font-family: "Noto Sans TC", sans-serif;
  font-weight: 500;
}
.button {
  display: inline-block;
  line-height: 40px;
  width: 120px;
  height: 40px;
  text-align: center;
  color: #fff;
  border: 2px solid #fb834c;
  border-radius: 4px;
  background-color: #fb834c;
  font-family: "Noto Sans TC", sans-serif;
  font-weight: 500;
  margin: 10px;
}
.box {
  padding: 10px 0;
}
.nametext {
  display: flex;
  flex-direction: column;
}
.label {
  padding: 10px;
}
.nametext #name,
#choice,
#sku,
#pri {
  padding: 10px;
  margin-left: 10px;
  border-radius: 10px;
  border: 1px solid #eee;
  background-color: #fff;
  width: 300px;
}
.typeselect {
  display: flex;
  flex-direction: column;
}
.skutext {
  display: flex;
  flex-direction: column;
}
.sex {
  margin: 10px;
  padding: 10px;
}
.pritext {
  display: flex;
  flex-direction: column;
}
.check {
  margin: 20px 0 20px 0;
  display: flex;
}
.checkbox {
  margin: 10px;
}
.check .item {
  padding: 0 10px;
}

              
            
!

JS

              
                
              
            
!
999px

Console