会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133683个问题
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS盒子模型 197楼

body部分

<div class="container">
    <div class="wrap">
        <div class="logo">
            <img src="images/logo-mi2.png" alt="">
        </div>
        <div class="nav-bar">
            <ul>
                <li class="first">无无无无无</li>
                <li><a href="#">Xiaomi手机</a></li>
                <li><a href="#">Redmi 红米</a></li>
                <li><a href="#">电视</a></li>
                <li><a href="#">笔记本</a></li>
                <li><a href="#">平板</a></li>
                <li><a href="#">家电</a></li>
                <li><a href="#">路由器</a></li>
                <li><a href="#">服务</a></li>
                <li><a href="#">社区</a></li>
            </ul>
        </div>
        <div class="search">
            <input type="text" placeholder="洗衣机">
            <button class="iconfont">&#xe63d;</button>
            <div class="mini-search">
                <ul>
                    <li><a href="#">全部</a></li>
                    <li><a href="#">手机</a></li>
                    <li><a href="#">小米平板5</a></li>
                    <li><a href="#">空调</a></li>
                    <li><a href="#">耳机</a></li>
                    <li><a href="#">黑鲨4S</a></li>
                    <li><a href="#">电视</a></li>
                    <li><a href="#">加湿器</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>

css部分

a{
    text-decoration: none;
    color: #b0b0b0;
    text-align: center;
}
.wrap{
    width: 1226px;
    margin: 0 auto;
}
.container{
    width: 100%;
    height: 100px;
    color: peru;
    position: relative;
}
.logo{
    width: 55px;
    height: 55px;
    margin-top: 22.5px;
    position: relative;
    overflow: hidden;
    float: left;
}
.logo img{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
}
.nav-bar{
    width: 873px;
    height: 100px;
    box-sizing: border-box;
    padding: 12px 0 0 30px;
    float: left;
}
.nav-bar .first{
    width: 127px;
    padding-right: 15px;
    color: #fff;
    line-height: 100px;
}
.nav-bar li{
    float: left;
}
.nav-bar a:not(.first){
    color: #333333;
    font-size: 16px;
    display: block;
    padding: 41px 10px 38px;
}
.search{
    width: 297px;
    height: 100px;
    position: relative;
    float: left;
}
.search>input{
    width: 223px;
    height: 48px;
    border: 1px solid #e0e0e0;
    padding: 0 10px;
    outline: none;
    float: left;
    margin-top: 25px;
    transition: all .2s;
}
.search>button{
    width: 52px;
    height: 50px;
    border: 1px solid #e0e0e0;
    border-left: none;
    padding: 1px 4px;
    margin-top: 25px;
    background-color: #fff;
    float: left;
}
.search>input:focus,.search>input:focus+button {
    border-color: #ff6700;
}
.search>input:hover,.search>input:hover+button{
    border-color: #b0b0b0;
}
.search>button:hover {
    background-color: #ff6700;
    border-color: #ff6700;
    color: #fff;
}
.container .mini-search{
    width: 243px;
    height: 240px;
    background-color: #b0b0b0;
    border: 1px solid #ff6700;
    border-top: none;
    position: absolute;
    top: 75px;
    left: 0;
    display: none;
}
.container .search>.mini-search ul>li>a{
    display: block;
    width: 243px;
    height: 30px;
    color: #424242;
    font-size: 12px;
    padding: 6px 15px;
}
.search>input:focus .mini-search{
    display: block;
}

image.png








为什么图布局是乱的啊救命

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 198楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 199楼

问题 :表单的不完美

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

小米.rar

老师为什么在搜索框哪里我鼠标聚焦的时候,边框颜色不会变成橘色呢

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 201楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5基础元素 202楼

小米官方.zip

在黑色导航的左侧栏中的,当鼠标滑动到“下载app”该内容时,三角形并未显示出来。

WEB前端全系列/第一阶段:HTML5+CSS3模块/商城官网项目 207楼

在作业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模块/表单 208楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 209楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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