接下来该咋弄呀,想了一个小时继续不下去了。

来源: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回答

好帮手慕言

2020-10-17

同学你好,是为了配合margin: 0 auto;实现水平居中的效果。以上次回答中,提供的代码为例,按钮是内联块元素,不能使用margin: 0 auto;实现水平居中的效果,因此才将按钮转换为了块元素。

代码具有灵活性,实现效果的方式有很多种,同学使用其他方式,实现水平居中的效果也是可以的。

0

好帮手慕言

2020-10-16

同学你好,解答如下:

1、可以给input设置宽高、margin等属性。

2、第四个输入框可以使用textarea标签实现

3、提交按钮可以使用<input type="submit" >实现。代码参考:

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

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

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

0
higorous阿炎
h 这道题需要转块级元素吗?之前课程是行内元素才转为块级元素。例子是a标签才转成块级元素。而这道题最后按钮发现是可以设置宽高的。。您最后转是为了实现什么呢。
h020-10-16
共2条回复

0 学习 · 15276 问题

查看课程