会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132600个问题
Python 全系列/第一阶段:Python入门/Python入门(动画版) 25546楼

问题 :表单的不完美

            a、今天学习了表单 但是效果很是不理想 下面是自己找的表单练习 和效果图的对比

            b、问:如何像效果图一样美丽?表单如何对齐?

            c、代码区:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="ok.html" align="center">
      
       <p>* 会 员 名 <input type="text"></p>

       <p>*登录密码<input type="password"></p>

       <p>*重复密码<input type="password"></p>

       <p>*联系人姓名<input type="text"></p>

       <p>*企业名称<input type="text"></p>

       <p>
        *贸易身份
        <input type="checkbox">我要销售
        <input type="checkbox">我要采购
        <input type="checkbox">两者都是
       </p>
     
       <p>
           电话号码
           <select name="" id="">
             <option value="" selected>中国大陆+86</option>
             <option value="">hello word</option>
             <option value="">hello word</option>
             <input type="text">
           </select>




       </p>









    </form>
</body>
</html>

          d、效果图:(自己做的效果图展示)

          屏幕截图(165).png




                        e、理想图:

                         屏幕截图(164).png

WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 25549楼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>post请求</title>
</head>
<body>
  <label for="username">
      <span>用户名:</span>
      <input type="text" id="username" class="username">
  </label> <br>
  <label for="password">
      <span>密码:</span>
      <input type="text" id="password" class="password">
  </label> <br>
  <button>登录</button>
<script>
      var usernameInput=document.querySelector('.username');
      var passwordInput=document.querySelector('.password');
      var btn=document.querySelector('button');
      btn.onclick=function () {
          var xhr=new XMLHttpRequest();
          xhr.onreadystatechange=function () {
              if(xhr.readyState==4){
                  if (xhr.status==200){
                    // console.log(xhr.responseText);
                    console.log(JSON.parse(xhr.responseText));
                  }
              }
          };
          xhr.open('post','3-post请求.php',true);
         //构建post表单数据,使用FormData类构建数据
          var datas=new FormData();
          datas.append('uname',usernameInput.value);
          datas.append('upass',passwordInput.value);
          xhr.send(datas);
      }
</script>
</body>
</html>
<php
 $success=array("msg"=>"ok","info"=>$_POST);
 echo json_encode($success);
?>

老师我这个里面报错了,我不知道是哪的问题

blob.png

WEB前端全系列/第六阶段:Http服务与Ajax模块(旧)/Http服务与Ajax编程 25550楼
Python 全系列/第二阶段:Python 深入与提高/游戏开发-坦克大战 25554楼
JAVA 全系列/(隐藏)第二十三阶段:数字货币交易所项目/服务中台_会员系统的开发 25555楼
WEB前端全系列/第十九阶段:Vue2知识体系(旧)/Vue基础知识 25557楼
Python 全系列/第一阶段:Python入门/编程基本概念 25558楼
JAVA 全系列/第五阶段:JavaWeb开发/JSP技术详解(旧) 25559楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637