接下来该咋弄呀,想了一个小时继续不下去了。
来源:4-6 自由编程
Vigorous阿炎
2020-10-16 15:31:06
<div class="banner">
<!-- 撑满整个web -->
<img class="A" src="images/dream.jpg">
<div class="b1"></div>
<div class="C">
<input class="b2" type="test" placeholder="your name">
<input class="b3" type="tel" width="504px" height="40px" placeholder="your phone">
<input class="b4" type="email" width="504px" height="40px" placeholder="your email">
<input class="b5" type="test" width="504px" height="110px" placeholder="write your content here">
<input class="b5" type="test" width="200px" height="40px" placeholder="send message">
</div>
</div>
css.css
/* 开始banner区域 */
.banner{
width: 100%;
height: 600px;
position: relative;
}
.banner .A{
/* 添加图片 */
width: 100%;
height: 600px;
}
.banner .b1{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 600px;
background-color:rgba(0, 0, 0, 0.5);
}
.banner .C{
position: absolute;
width: 504px;
height: 362px;
top: 50%;
margin-top: -175px;
left: 50%;
margin-left: -252px;
border:2px solid rgb(179, 248, 18);
}
.banner .C ul li{
float: left;
width: 504px;
height: 40px;
background-color: tomato;
}
在这里输入代码,可通过选择【代码语言】突出显示
2回答
同学你好,是为了配合margin: 0 auto;实现水平居中的效果。以上次回答中,提供的代码为例,按钮是内联块元素,不能使用margin: 0 auto;实现水平居中的效果,因此才将按钮转换为了块元素。
代码具有灵活性,实现效果的方式有很多种,同学使用其他方式,实现水平居中的效果也是可以的。
好帮手慕言
2020-10-16
同学你好,解答如下:
1、可以给input设置宽高、margin等属性。
2、第四个输入框可以使用textarea标签实现
3、提交按钮可以使用<input type="submit" >实现。代码参考:


宽高不能直接写在input标签上,是不生效的,可以使用css设置,另外:同学可以按照要求,再修改一下样式
相似问题