亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么顯示錯誤后我的表單高度會增加?

為什么顯示錯誤后我的表單高度會增加?

幕布斯7119047 2023-04-14 15:16:16
我正在學習前端,我正在嘗試從前端發起挑戰,它還包括一些表單驗證。因此,每當用戶提交表單時,如果任何輸入字段為空,輸入中應出現一個小錯誤圖像,并且輸入下方還應有一行說明輸入字段不應為空。因此,當出現錯誤時,會出現圖像和線條,但我的表格高度會增加。我給了 body 和封閉的容器一個最小高度,但它仍然不工作..挑戰鏈接 挑戰鏈接代碼筆鏈接代碼筆代碼<!DOCTYPE html><html><head>  <meta charset="UTF-8">  <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->  <link rel="stylesheet" href="style.css">  <link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">    <title>Frontend Mentor | Intro component with sign up form</title>  <!-- Feel free to remove these styles or customise in your own stylesheet ?? --> </head><body>  <div class="container">    <div class="left">      <h1>  Learn to code by watching others</h1>      <p>See how experienced developers solve problems in real-time. Watching scripted tutorials is great,         but understanding how developers think is invaluable. </p>    </div>    <div class="right">        <div class="heading">          <p>Try it free 7 days <span>then $20/mo. thereafter</span></p>        </div>        <form action="#">          <div>            <input type="text" placeholder="First Name">            <img class="error-image" src="images/icon-error.svg" alt="">            <p class="error-text">First Name cannot be empty</p>          </div>                    <div>            <input type="text" placeholder="Last Name">            <img class="error-image" src="images/icon-error.svg" alt="">            <p class="error-text">Last Name cannot be empty</p>          </div>                    <div>            <input type="text" placeholder="Email Address">            <img class="error-image" src="images/icon-error.svg" alt="">            <p class="error-text">Looks like this is not an email</p>          </div>                  </form>      </div>    </div>  </div>  <script src="index.js"></script></body></html>
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 150 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號