|
发表于 2021-4-26 13:09:14
|
显示全部楼层
那个div的 先放放吧
你如果有空 先帮我看看这个代码,这个代码最下面的4个按钮的位置,总是随着浏览器的变化 而变化
导致页面很丑
- <!DOCTYPE.html>
- <html>
- <head>
- <title>CHENGUOFENG's PAGE</title>
- <meta charset="utf-8">
- <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
- </script>
- <style type="text/css">
- .style1 {
- font-size: x-large;
- font-weight: bold;
- color: #FF0000;
- }
-
- .style2 {
- text-align: center;
- }
-
- #btn_1 {
- width: 75px;
- }
-
- .style3 {
- color: #0000FF;
- font-weight: 700;
- }
- </style>
- </head>
- <body id="mainbody">
- <div class="style2">
- <label for="input_1"><span class="style1">
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- 乾安联通实时经营信息系统 <br />
- </span></label><br> 员工姓名: <input type="text" id="name" /><br />
- <br> 系统密码: <input type="password" id="pwd" />
- </div>
- <div class="form-group">
- </div>
- <p>
- </p>
- <p>
-
- <button id="denglu" class="style3" type="button"><b>发展录入</b></button>
- <button id="chaxun" class="style3" type="button">日报查询 </button>
- <button id="ybchaxun" class="style3" type="button">月报查询 </button>
- <button id="weihu" class="style3" type="button"><b>系统维护</b></button>
- </p>
- <script>
- $('#denglu').on('click', function() {
- var name = document.getElementById("name").value;
- var pwd = document.getElementById("pwd").value;
- console.log(name);
- if (name == "" || pwd == "") {
- alert("帐号和密码不能为空");
- } else {
- //console.log(htmlname) ;
- $.ajax({
- type: "get",
- url: "/login",
- data: {
- 'name': name,
- "pwd": pwd
- },
- ContentType: 'text/html',
- dataType: "html",
- success: function(hdata) {
- if (hdata) {
- if (hdata === "error") {
- console.log("hello is wo ");
- console.log(typeof(hdata));
- }
- console.log("come in 121");
- console.log(typeof(hdata));
- //console.log(hdata);
- //$("#main").html(hdata);
- var html2 = "";
- html2 += hdata;
- //alert("html2");
- $("#mainbody").html(hdata);
- } else {
- console.log("失败了");
- }
- },
- error: function(data, XMLHttpRequest, textStatus, errorThrown) {
- console.log(data);
- console.log(XMLHttpRequest.status);
- console.log(XMLHttpRequest.readyState);
- console.log(textStatus);
- }
- });
- }
- });
- /////////////维护界面//////////////////////////////
- $('#weihu').on('click', function() {
- var name = document.getElementById("name").value;
- var pwd = document.getElementById("pwd").value;
- console.log(name);
- if (name == "" || pwd == "") {
- alert("帐号和密码不能为空");
- } else {
- //console.log(htmlname) ;
- $.ajax({
- type: "get",
- url: "/weihu",
- data: {
- 'name': name,
- "pwd": pwd
- },
- ContentType: 'text/html',
- dataType: "html",
- success: function(hdata) {
- if (hdata) {
- if (hdata === "error") {
- console.log("hello is wo ");
- console.log(typeof(hdata));
- }
- console.log("come in 121");
- console.log(typeof(hdata));
- console.log(hdata);
- //$("#main").html(hdata);
- var html2 = "";
- html2 += hdata;
- //alert("html2");
- $("#mainbody").html(hdata);
- } else {
- console.log("失败了");
- }
- },
- error: function(data, XMLHttpRequest, textStatus, errorThrown) {
- console.log(data);
- console.log(XMLHttpRequest.status);
- console.log(XMLHttpRequest.readyState);
- console.log(textStatus);
- }
- });
- }
- });
- ////////////////////////查询界面//////////////////////////////////
- $('#chaxun').on('click', function() {
- var name = document.getElementById("name").value;
- var pwd = document.getElementById("pwd").value;
- console.log(name);
- if (name == "" || pwd == "") {
- alert("帐号和密码不能为空");
- } else {
- //console.log(htmlname) ;
- $.ajax({
- type: "get",
- url: "/chaxun",
- data: {
- 'name': name,
- "pwd": pwd
- },
- ContentType: 'text/html',
- dataType: "html",
- success: function(hdata) {
- if (hdata) {
- if (hdata === "error") {
- console.log("hello is wo ");
- console.log(typeof(hdata));
- }
- console.log("come in 121");
- console.log(typeof(hdata));
- console.log(hdata);
- //$("#main").html(hdata);
- var html2 = "";
- html2 += hdata;
- //alert("html2");
- $("#mainbody").html(hdata);
- } else {
- console.log("失败了");
- }
- },
- error: function(data, XMLHttpRequest, textStatus, errorThrown) {
- console.log(data);
- console.log(XMLHttpRequest.status);
- console.log(XMLHttpRequest.readyState);
- console.log(textStatus);
- }
- });
- }
- });
- </script>
- </body>
- </html>
复制代码 |
|