表单那块儿感觉问题比较大,透明和居中都有问题

来源:4-3 项目作业

慕沐7264149

2020-01-06 22:51:06

<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <title>家庭作业</title>
 <link rel="stylesheet" type="text/css" href="css/common.css">
 <script type="text/javascript" src="js/js.js"></script>
</head>
<body>
 <div class="header">
  <div class="logo"><img src="images/logo.png"></div>
  <div class="menu">
   <ul class="menulist">
    <li><a href="#">HOME</a></li>
    <li><a href="#">ABOUT</a></li>
    <li><a href="#">GALLERY</a></li>
    <li><a href="#">FACULTY</a></li>
    <li><a href="#">EVENTS</a></li>
    <li><a href="#">CONTACT</a></li>
   </ul>
  </div>
 </div>
 <div class="body">
  <div class="banner">
   <img src="images/banner3.jpg" class="banner-image">
   <div class="registform">
    <input type="text" name="" placeholder="your Name"> <br>
    <input type="text" name="" placeholder="your Phone"> <br>
    <input type="text" name="" placeholder="your Email"> <br>
    <input class="commit" type="text" name="" placeholder="write your comments here"> <br>
    <input class="submit" type="button" name="" value="SEND MESSAGE">
   </div>
  </div>
 </div>
 <div class="foot"></div>
</body>
</html>

======================

*{
 margin: 0px;
 padding: 0px;
 font-family: Microsoft YaHei UI;
}
.header {
 background-color:#07cbc9;
 height: 52px;
}

.header .logo {
 float: left;
}
.header .menu {
 float: right;
}
.header .menu .menulist{
 list-style: none;
 height: 52px;
 line-height: 52px;
}
.header .menu .menulist li{
 float: left;
 margin-right: 15px;
 font-weight: bold;
}
.header .menu .menulist li a{
 color: #ffffff;
}
/*消除超链接的下划线*/
a{
 text-decoration-line: none;
}
.body .banner {
 height: 425px;
}
.body .banner .banner-image{
 width: 100%;
 height: 425px;
}
/*这个东西设置不了背景图片*/
.body .banner .registform{
 position: absolute;
 left: 37.5%;
 top: 100px;
}

.body .banner .registform .commit{
 width: 300px;
 height: 140px;
}

.body .banner .registform .submit{
 position: absolute;
 left: 39%;
 width: 100px;
 height: 30px;
}
.body .banner .registform input{
 border:2px solid white;
 opacity: 0.3;
 background-color: none;
 color: #000;
 width: 300px;
 height: 28px;
 margin-top: 5px;
}


写回答

1回答

好帮手慕酷酷

2020-01-07

同学你好,

1、透明问题,可以使用background中transparent值设置背景颜色透明。边框可以设置为灰色,可以不设置透明度opacity,字体的颜色可以设置为浅灰#bdbdbd。

具体如下:

http://img.mukewang.com/climg/5e13f495093da25c03740149.jpg

2、居中问题,可以将表单整体向右移动50%,再往回移动表单一半的距离。具体如下:

http://img.mukewang.com/climg/5e13f6e4091d39ee02840129.jpg

提交按钮重新定位一下位置,距离左侧35%的距离。具体如下:

http://img.mukewang.com/climg/5e13f7130961ec3803180098.jpg

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!



0

0 学习 · 9666 问题

查看课程