会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133730个问题
WEB前端全系列/第一阶段:HTML5+CSS3模块/商城官网项目 181楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 182楼

<!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新特性 183楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/前端入门与基础知识 186楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 188楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 190楼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>轮播图的设计与实现</title>
    <link rel="stylesheet" href="reset.css">
    <style>
        .wrapper{
            width:600px;
            height:600px;
            position:relative; 
        }
        .content{
            width:300px;
            height:300px;
        }
        .items{position: relative;}
        .items img{
            width:300px;
            height:300px;
            position:absolute;
        }
        .circle li{
            width:10px;
            height:10px;
            border-radius:50%;
            background-color: chocolate;
            float:left;
            margin: 0 6px;
        }
        .circle{position:absolute;right:160px;
        bottom:320px;}
        .prev{
        position:absolute;
        left:180px;
        top:200px;
        width:40px;
        height:60px;
        background: url("image/6.png");
        background-size: 40px;
        background-repeat: no-repeat;
        
    }
     .next{
        position:absolute;
        right:180px;
        top:200px;
        width:40px;
        height:60px;
        background: url("image/7.png");
        background-size: 40px;
        background-repeat: no-repeat;
        
    }
    </style>
</head>
<body>
    <div class="wrapper">
       <div class="content">
       <div class="items"><img src="image/luo1.jpg" alt=""></div>
       <div class="items"><img src="image/luo6.jpg" alt=""></div>
       <div class="items"><img src="image/luo3.jpg" alt=""></div>
       <div class="items"> <img src="image/luo4.jpg" alt=""></div>
       <div class="items"><img src="image/luo5.jpg" alt=""></div>
       <div class="items"> <img src="image/luo3.jpg" alt=""></div>
       </div>
       <ul class="circle">
        <li id="pic1"></li>
        <li id="pic2"></li>
        <li id="pic3"></li>
        <li id="pic4"></li>
        <li id="pic5"></li>
        <li id="pic6"></li>
    </ul>
     <!-- 图片左右方来回滚动图片的左右箭头-->
     <a href=" " class=" prev"></a>
     <a href="#" class=" next"></a> 
    </div>  
</body>
</html>

老师,我这里content没有设置居中,图片应该在最左侧,这里怎么显示在这个位置?图片.png

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 192楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/响应式项目 193楼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./iconfont.css">
    <style>
 
        *{
            margin: 0;
            padding: 0;
        }
 
        body{
            background-color: #f1f1f1;
        }
 
        .slide{
            width: 234px;
            height: 420px;
            background-color: rgba(105,101, 101, 0.6);
            padding: 20px 0;
            margin: 100px;
            position: relative;
        }
 
        .slide ul{
            list-style: none;
        }
 
        .slide ul li{
            width: 100%;
            height: 42px;
            line-height: 42px;
            text-align: left;
            padding-left: 30px;
            box-sizing: border-box;
        }
 
        .slide ul li:hover{
            background-color: #ff6700;
        }
 
        .slide ul li a{
            display: inline-block;
            text-decoration: none;
            color: #fff;
        }
 
        .slide .iconfont{
            display: inline-block;
            font-size: 24px;
            color: #fff;
            position:absolute;
            right: 10px;
        }
 
        .slide-list{
            width: 992px;
            height: 460px;
            background-color: #fff;
            position: absolute;
            top: 0;
            left: 234px;
            border: 1px solid #e0e0e0;
            border-left: none;
            box-sizing: border-box;
            box-shadow: 0 4px 16px rgba(0,0,0,0.18);
            display: none;
        }
 
        /* 鼠标滑动到li标签上,让slide-list的div显示 */
        .slide ul li:hover>.slide-list{
            display: block;
        }
 
    </style>
</head>
<body>
 
    <div class="slide">
        <ul>
            <li>
                <a href="#">手机</a>
                <span class="iconfont icon-ico_listarrow"></span>
                <div class="slide-list">小米1</div>
            </li>
            <li>
                <a href="#">电视</a>
                <span class="iconfont icon-ico_listarrow"></span>
                <div class="slide-list">小米2</div>
            </li>
        </ul>
    </div>
     
</body>
</html>
老师,你好!这段代码里的 a标签和span标签为什么要设置成行内块级元素呢


WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS应用技巧 194楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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