会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133730个问题

问题 :表单的不完美

            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模块/表单 601楼

问题:自己做了一个个人简历的表格 请老师帮忙看看是否有问题

          a、周末对表格的练习和巩固知识

          b、代码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格练习</title>
</head>
<body>
    <table cellspacing="0" border="1px" align="center" >
        <caption>个人简历表格</caption>
        <tr>
            <td colspan="11" align="center">个人简历</td>
        </tr>

        <tr>
            <td colspan="11" align="right" valign="top">流水号:###</td>
        </tr>

        <tr align="center">
            <td>*姓名</td>
            <td>hello</td>
            <td>*性别</td>
            <td>hello</td>
            <td>*生日</td>
            <td>hello</td>
            <td>*民族</td>
            <td>hello</td>
            <td colspan="3" rowspan="2" valign="top">照片</td> 
        </tr>

        <tr align="center">
            <td>*籍贯</td>
            <td>hello</td>
            <td>*身高</td>
            <td>hello</td>
            <td>*政治面貌</td>
            <td>hello</td>
            <td>*职位</td>
            <td>hello</td>
           
        </tr>

        <tr>     
        </tr>

        <tr align="center">
            <td>联系电话</td>
            <td colspan="3"></td>
            <td>昵称</td>
            <td colspan="2"></td>
            <td>个人爱好</td>
            <td colspan="3"></td>
          
        </tr>

        <tr align="center">
            <td>学校地址</td>
            <td colspan="3"></td>
            <td>*QQ</td>
            <td colspan="2"></td>
            <td>E-mail</td>
            <td colspan="3"></td>
        </tr>

        <tr>
            <td>什么方式了解?</td>
            <td colspan="10">&nbsp朋友介绍?&nbsp;网络?&nbsp;传单?&nbsp
                官网?&nbsp;?&nbsp传单?
            </td>
        
        </tr>

        <tr>
            <td rowspan="3" align="center">社会经历</td>
            <td colspan="10" rowspan="3"></td>
        </tr>

        <tr>  
        </tr>

        <tr>
        </tr>

        <tr>
            <td rowspan="3" align="center">个人经历</td>
            <td colspan="10" rowspan="3"></td>
        </tr>

        <tr>  
        </tr>

        <tr>
        </tr>

        <tr>
            <td rowspan="3" align="center">证书</td>
            <td colspan="10" rowspan="3"></td>
        </tr>

        <tr>  
        </tr>

        <tr>
        </tr>
        <tr>
            <td rowspan="3" align="center">奖项</td>
            <td colspan="10" rowspan="3"></td>
        </tr>

        <tr>  
        </tr>

        <tr>
        </tr>

    </table>
</body>
</html>

c、效果图:

屏幕截图(152).png

WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5基础元素 604楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5基础元素 607楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5基础元素 608楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5新增元素 610楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS应用技巧 611楼

在作业3中产生疑问:当我把第二、第三两个form注释掉时,运行效果一样,那我是否可以只写第一个form,这样更简洁?

一、没注释前

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业3</title>
</head>
<body>
<table border="1" width="600" height="100" align="center" cellspacing="0"cellpadding="1">
    <tr>
        <td align="right">用户名:</td>
        <td align="center">
            <form action="ok.html" name="form1">
                <input type="text">
            </form>
        </td>
    </tr>
    <tr>
        <td align="right">密码:</td>
        <td align="center">
            <form action="ok.html" name="form2">
                <input type="password" name="password">
            </form>
        </td>
    </tr>
    <tr>
        <td align="right">性别:</td>
        <td align="center">
            <form action="ok.html" name="form3">
            <input type="radio" name="sex" checked>
            <lable for="man">男</lable>
            <input type="radio" name="sex">
            <lable for="woman">女</lable>
            </form>
        </td>
    </tr>
</table>
</body>
</html>

二、注释后

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业3疑问</title>
</head>
<body>
<table border="1" width="600" height="100" align="center" cellspacing="0"cellpadding="1">
    <tr>
        <td align="right">用户名:</td>
        <td align="center">
            <form action="ok.html" name="form1">
                <input type="text">
            </form>
        </td>
    </tr>
    <tr>
        <td align="right">密码:</td>
        <td align="center">
<!--            <form action="ok.html" name="form2">-->
                <input type="password" name="password">
<!--            </form>-->
        </td>
    </tr>
    <tr>
        <td align="right">性别:</td>
        <td align="center">
<!--            <form action="ok.html" name="form3">-->
                <input type="radio" name="sex" checked>
                <lable for="man">男</lable>
                <input type="radio" name="sex">
                <lable for="woman">女</lable>
<!--            </form>-->
        </td>
    </tr>
</table>
</body>
</html>

效果一

image.png

效果二

image.png

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

style>
        .box{
            width: 234px;
            height: 300px;
            background-color: pink;
            position: relative;
            overflow: hidden;
        }
        .box1{
            width: 100%;
            height: 76px;
            background-color: orange;
            /*绝对定位  相对于已经定位的父元素定位*/
            position: absolute;
            /*据父元素上面的距离为300px*/
            top: 300px;
            /*据父元素的左侧距离为0*/
            left: 0px;
        }
        /*鼠标悬停在box上,子代box1*/
        .box:hover>.box1{
           /*据父元素上面的距离变为224*/
            top: 224px;
        }
        .box2{
            width: 303px;
            height: 375px;
            background-color: red;
            position: relative;
        }
        .box2>img{
            width: 100%;
            height: 100%;
        }
        .box3{
            width: 100%;
            height: 100%;
            background-color: salmon(0,0,0,.2);
            position: absolute;
            top: 0px;
            left: 303px;
        }
        .box2:hover>.box3{
            left: 0;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="box1"></div>
    </div>
    <div class="box2">
        <img src="img/370ad36f-425c-453a-b406-ccb2a0dffeec.jpg" alt="">
        <div class="box3"></div>
    </div>
</body>
</html>

老师,我这个代码哪里不对吗?为啥达不到老师说的效果


WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS常用属性 614楼

<style>
        *{
            margin: 0;
            padding: 0;
        }
        a{
            text-decoration: none;
        }
        .box{
            width: 303px;
            height: 375px;
            background-color: red;
            position: relative;

        }
        .box img{
            width: 100%;
        }
        .text{
            width: 100%;
            height: 88px;
            position: absolute;
            left: 0px;
            bottom: 20px;
            text-align: center;
        }
        .name{
            color: #fff;
            font-size: 21px;
            font-weight: 800;
        }
        .yang{
            color: #fff;
            font-size: 14px;
        }
        .yg{
            color: #ebce6b;
            font-size: 24px;
            font-weight: 700;

        }
    </style>
</head>
<body>
    <div class="box">
<a href="">
    <img src="img/370ad36f-425c-453a-b406-ccb2a0dffeec.jpg" alt="">
    <div class="text">
        <p class="name">MEIZU UR 高端定制耳机 预约</p>
        <p class="yang">【预约专用】私人定制,为你而声</p>
        <p class="yg">¥200</p>
    </div>
</a>
    </div>
</body>
</html>

老师,这个font代码在这里有啥作用?

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS常用属性 615楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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