首页 > 其他分享 >FreeCodeCamp-通过编写注册表单学习 HTML 表单

FreeCodeCamp-通过编写注册表单学习 HTML 表单

时间:2023-05-05 21:56:22浏览次数:38  
标签:freeCodeCamp color border width HTML FreeCodeCamp 注册表 input margin

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>
      <fieldset>
        <label for="first-name">Enter Your First Name: <input id="first-name" name="first-name" type="text" required /></label>
        <label for="last-name">Enter Your Last Name: <input id="last-name" name="last-name" type="text" required /></label>
        <label for="email">Enter Your Email: <input id="email" name="email" type="email" required /></label>
        <label for="new-password">Create a New Password: <input id="new-password" name="new-password" type="password" pattern="[a-z0-5]{8,}" required /></label>
      </fieldset>
      <fieldset>
        <label for="personal-account"><input id="personal-account" type="radio" name="account-type" class="inline" /> Personal Account</label>
        <label for="business-account"><input id="business-account" type="radio" name="account-type" class="inline" /> Business Account</label>
        <label for="terms-and-conditions">
          <input id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" class="inline" /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
        </label>
      </fieldset>
      <fieldset>
        <label for="profile-picture">Upload a profile picture: <input id="profile-picture" type="file" name="file" /></label>
        <label for="age">Input your age (years): <input id="age" type="number" name="age" min="13" max="120" /></label>
        <label for="referrer">How did you hear about us?
          <select id="referrer" name="referrer">
            <option value="">(select one)</option>
            <option value="1">freeCodeCamp News</option>
            <option value="2">freeCodeCamp YouTube Channel</option>
            <option value="3">freeCodeCamp Forum</option>
            <option value="4">Other</option>
          </select>
        </label>
        <label for="bio">Provide a bio:
          <textarea id="bio" name="bio" rows="3" cols="30" placeholder="I like coding on the beach..."></textarea>
        </label>
      </fieldset>
      <input type="submit" value="Submit" />
    </form>
  </body>
</html>

​styles.css

body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
  font-family: Tahoma;
  font-size: 16px;
}

h1, p {
  margin: 1em auto;
  text-align: center;
}

form {
  width: 60vw;
  max-width: 500px;
  min-width: 300px;
  margin: 0 auto;
  padding-bottom: 2em;
}

fieldset {
  border: none;
  padding: 2rem 0;
  border-bottom: 3px solid #3b3b4f;
}

fieldset:last-of-type {
  border-bottom: none;
}

label {
  display: block;
  margin: 0.5rem 0;
}

input,
textarea,
select {
  margin: 10px 0 0 0;
  width: 100%;
  min-height: 2em;
}

input, textarea {
  background-color: #0a0a23;
  border: 1px solid #0a0a23;
  color: #ffffff;
}

.inline {
  width: unset;
  margin: 0 0.5em 0 0;
  vertical-align: middle;
}

input[type="submit"] {
  display: block;
  width: 60%;
  margin: 1em auto;
  height: 2em;
  font-size: 1.1rem;
  background-color: #3b3b4f;
  border-color: white;
  min-width: 300px;
}

input[type="file"] {
  padding: 1px 2px;
}

标签:freeCodeCamp,color,border,width,HTML,FreeCodeCamp,注册表,input,margin
From: https://www.cnblogs.com/is-wgy/p/17375458.html

相关文章

  • HTML5中的document.visibilityState
    在HTML5中,文档对象(即document对象)具有一个visibilityState属性,该属性表示当前文档对象的可见性状态。visibilityState可能的取值有以下三种:-visible:表示文档当前处于激活状态,即当前选项卡处于前台或当前窗口处于屏幕最上层。-hidden:表示文档当前处于非激活状态,......
  • 注册表RootKey简写:HKCR, HKCU, HKLM, HKU, and HKCC
    WhatDoHKCR,HKCU,HKLM,HKU,andHKCCMean?(RegistryRootKeys)By Rich Note: TogetabetterunderstandingofWindowsRegistrybasics,read thisguide.Ifyou’resomewhatfamiliarwiththeWindowsRegistry,you’venodoubtseenreferencestoHKCR,HKCU......
  • 如何通过C#/VB.NET代码将PowerPoint转换为HTML
    利用PowerPoint可以很方便的呈现多媒体信息,且信息形式多媒体化,表现力强。但难免在某些情况下我们会需要将PowerPoint转换为HTML格式。因为HTML文档能独立于各种操作系统平台(如Unix,Windows等)。并且它可以加入图片、声音、动画、影视等内容,还能从一个文件跳转到另一个文件,与世界各地......
  • HTML中LINK标签的那些属性
    在HTML中, link 标签是一个自闭合元素,通常位于文档的head部分。它用于建立与外部资源的关联,如样式表、图标等。 link 标签具有多个属性,其中 rel 和 href 是最常用的。 rel属性定义了当前文档与链接资源之间的关系。常见的rel属性值有:-stylesheet:表示链接到一个......
  • C#操作注册表
    //创建注册表下并加载信息。publicboolregistryCreateAndSet(stringFillName,stringName,stringValue){try{//引用HKEY_CURRENT_USERRegistryKeykey=Registry.C......
  • FreeCodeCamp-通过编写咖啡店菜单学习CSS
    index.html<!DOCTYPEhtml><htmllang="en"><head><metacharset="utf-8"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><title>CafeMenu......
  • vue学习 第十天(2) HTML5的新特性 ----- 语义化标签(布局标签)/ 多媒体标签(video、
    目标:能够说出3~5个HTML5新增布局和表单标签能够说出CSS3的新增特性有哪些 HTML5的新特性 HTML的新增特性主要是针对于以前的不足,增加了一些新的标签、新的表单和新的表单属性等。新特性都有兼容性问题,基本是IE9+以上版本......
  • html初次进入页面只刷新一次!!一次!!!!
    window.onload=function(){reloadPage();}//自动刷新一次页面functionreloadPage(){if(location.href.indexOf('#reloaded')==-1){//判断是否有刷新标记location.href=location.href+"#reloaded";//没有添加标记location.reload();//刷新}......
  • HTML5+CSS3
    CSS3HTMLHTML总结......
  • 注册表解决Office自动升级问题
    Office自动升级问题问题:当我早上准备打开PPT准备毕业论文中期答辩时,意外发现Office应用打不开反而跳转到MicrosoftOffice365的升级页面(该升级页面最终会显示错误代码),无法通过office内部应用来关闭自动升级。解决:1.Win+R键输入regedit回车打开注册表2.在文件下方......