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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 200px;
            height: 100px;
            background-color: green;
            transform: translate(10px,10px);
            margin: 50px;
        }
        .box2{
            width: 200px;
            height: 100px;
            background-color: red;
            margin: 50px;
            transform: rotate(30deg);
        }
        .box3{
            width: 200px;
            height: 100px;
            background-color: yellow;
            margin: 50px;
            transform: scale(1.2,1.5);
        }
        .text{
            /* transform: scale(0.5); */
            font-size: smaller;
        }
    </style>
</head><!--  -->
<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>

    <p class="text">我是6PX字号</p>
    <p>我是默认12PX字号</p>
</body>
</html>

image.png

老师,默认最小字体不是12px吗,我这里直接修改字号也能修改,不用transform:scale(0.5)来缩放,是和我Chrome浏览器的版本有关吗

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 2楼

8c603338652291c85e40849fb9f3648a.png

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: red;
            padding: 50px;
            border: 20px solid green;
            margin: 50px;
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>

为什么浏览器盒子模型里面的border老和我设置的border有一点差距,设置20px,但是浏览器里显示19.512


WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS盒子模型 3楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 4楼

<!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>
    <table>
        <tr>
            <td>姓名:</td>
            <td>
                <form>
                    <input type="text">
                </form>
            </td>
        </tr>
        <tr>
            <td>密码:</td>
            <td>
                <form>
                    <input type="password">
                </form>
            </td>
        </tr>
        <tr>
            <td>确认密码:</td>
            <td>
                <form>
                    <input type="password">
                </form>
            </td>
        </tr>
        <tr>
            <td>密码提示问题:</td>
            <td>
                <form>
                    <select>
                        <option value="title">请选择一个问题</option>
                        <option value="1">1</option>
                        <option value="2">2</option>
                    </select>
                </form>
            </td>
        </tr>
        <tr>
            <td>密码提示答案:</td>
            <form>
                <input type="text">
            </form>
        </tr>
        <tr>
            <td>性别</td>
            <td>
                <form>
                    <input type="radio" name="sex">男<br>
                    <input type="radio" name="sex">女
                </form>
            </td>
        </tr>
        <tr>
            <td>年龄:</td>
            <td>
                <form>
                    <input type="number">
                </form>
            </td>
        </tr>
        <tr>
            <td>籍贯:</td>
            <td>
                <form>
                    <select>
                        <option value="title">请选择</option>
                    </select>
                    省/直辖市
                    <select>
                        <option value="title">请选择</option>
                    </select>
                    市<br>
                </form>
            </td>
        </tr>
        <tr>
            <td>爱好:</td>
            <td>
                <form>
                    <input type="checkbox" value="1">上网
                    <input type="checkbox" value="2">看电影
                    <input type="checkbox" value="3">学习
                </form>
            </td>
        </tr>
        <tr>
            <td>个人介绍:</td>
            <td></td>
        </tr>
        <tr>
            <td>上传头像</td>
            <td></td>
        </tr>
        <tr>
            <td colspan="2"></td>
        </tr>
    </table>
</body>
</html>
老师我的table外面有一个input框不知道是哪里来的,找不到


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

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #container {
            display: grid;
            grid-template-columns: 200px 200px 200px;
            grid-template-rows: 200px 200px 200px 200px 200px;
            grid-template-areas: "item1 item1 item1"
                                 "item2 item3 item4"
                                 "item5 item5 item6"
                                 "item7 item8 item8"
                                 "item9 item9 item9";

        }

        .item {
            font-size: 35px;
            text-align: center;
            border: 1px solid #e5e4e9;
        }

        .item-1 {
            grid-area: item1;
            background-color: #ef342a;
        }

        .item-2 {
            /* grid-area: item2; */
            background-color: #f68f26;
        }

        .item-3 {
            /* grid-area: item3; */
            background-color: #4ba946;
        }

        .item-4 {
            grid-area: item4;
            background-color: #0376c2;
        }

        .item-5 {
            grid-area: item5;
            background-color: #c077af;
        }

        .item-6 {
            grid-area: item6;
            background-color: #f8d29d;
        }

        .item-7 {
            grid-area: item7;
            background-color: #b5a87f;
        }

        .item-8 {
            grid-area: item8;
            background-color: #d0e4a9;
        }

        .item-9 {
            grid-area: item9;
            background-color: #4dc7ec;
        }
    </style>
</head>

<body>


    <div id="container">
        <div class="item item-1">1</div>
        <div class="item item-2">2</div>
        <div class="item item-3">3</div>
        <div class="item item-4">4</div>
        <div class="item item-5">5</div>
        <div class="item item-6">6</div>
        <div class="item item-7">7</div>
        <div class="item item-8">8</div>
        <div class="item item-9">9</div>
    </div>

</body>

</html>

老师,我的代码哪里有问题呢,我看您注释掉就显示空白了,但是我的代码注释了后还是在显示的

image.png

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

课程分类

百战程序员微信公众号

百战程序员微信小程序

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