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

<div class="info">
    <img src="image/logo-footer.png" alt="">
    <p class="site">
        <a href="#">小米商城 <span>|</span></a>
        <a href="#"> MIUI<span>|</span></a>
        <a href="#">米家<span>|</span></a>
        <a href="#">米聊<span>|</span></a>
        <a href="#">多看<span>|</span></a>
        <a href="#">游戏<span>|</span></a>
        <a href="#">政企服务<span>|</span></a>
        <a href="#">小米天猫店<span>|</span></a>
        <a href="#">小米集团隐私政策 <span>|</span></a>
        <a href="#">小米公司儿童信息保护规则<span>|</span></a>
        <a href="#">小米商城隐私政策<span>|</span></a>
        <a href="#">小米商城用户协议<span>|</span></a>
        <a href="#">问题反馈 <span>|</span></a>
        <a href="#"> Select Location</a>
    </p>
    <p class="banquan">
        &copy;
        <a href="#"> mi.com</a>
         <span>京ICP证110507号 </span>
        <a href="#">京ICP备10046444号</a>
        <a href="#">京公网安备11010802020134号</a>
        <a href="#">京网文[2020]0276-042号</a>
        <a href="#">(京)网械平台备字(2018)第00005号</a>
        <a href="#">互联网药品信息服务资格证 (京)-非经营性-2014-0090</a>
        <a href="#">营业执照</a>
        <a href="#">医疗器械质量公告</a>
        <a href="#">增值电信业务许可证 </a>
        <span>网络食品经营备案 京食药网食备202010048</span>
        <a href="#">食品经营许可证</a>
        <a href="#">违法和不良信息举报电话:171-5104-4404</a>
        <a href="#">知识产权侵权投诉</a>
        <span>本网站所列数据,除特殊说明,所有数据均出自我司实验室测试</span>
    </p>
</div>
.info img{
    width: 57px;
    height: 57px;
    margin-right: 10px;
    float: left;

}
.site{
    margin: 0;
    line-height: 18px;
    float: left;
}
.site a{
    color: #757575;
    background-color: rgba(0,0,0,0);
    font-size: 12px;
}
.site a:hover{
    color: #ff6700;
}
.banquan{
    height: 70.4px;
    float: left;
    font-size: 12px;
    color: #b0b0b0;

}
.banquan a{
    font-size: 12px;
    color: #b0b0b0;
}
.banquan a:hover{
    color: #ff6700;
}

老师我想让那个那段文字到上面去,老师看看我的有什么问题吗blob.pngblob.png

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

<!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>
    <style>

        *{
            margin: 0;
            padding: 0;
        }

        body{
            background-color: #f1f1f1;
        }

        .container{
            width: 1240px;
            margin: 0 auto;
        }

        .container ul{
            overflow: hidden;
            clear: both;
        }

        .container ul li{
            position: relative;
            float: left;
            list-style: none;
            background-color: #fff;
            margin-top: 10px;
            margin-right: 9px;
            width: 303px;
            height: 375px;
        }

        .container ul li a img{
            height: 230px;
            margin-top: 30px;
        }

        .container ul li:nth-child(4n){
            margin-right: 0;
        }

        .container ul li a{
            display: block;
            width: 100%;
            height: 100%;
            text-align: center;
            text-decoration: none;
        }

        .text .name{
            display: block;
            color: #333;
            font-size: 16px;
            margin-bottom: 2px;
        }

        .text .desc{
            display: block;
            color: #999;
            font-size: 14px;
        }
 
        .text .price i{
            font-style: normal;
            font-size: 14px;
            bottom: 3px;
        }
 
        .text .price{
            display: inline-block;
            color: #c00;
            font-size: 22px;
            padding-left: 14px;
        }
 
        .text .price em{
            font-size: 16px;
            font-style: normal;
        }
 
        .product-sign{
            position:absolute;
            top: 30px;
            left: 30px;
            display: block;
            width: 60px;
            height: 60px;
            background-color: #ff64a6;
            border-radius: 50%;
            line-height: 60px;
            color: #fff;
            font-size: 16px;
            text-align: center;
        }
 
 
    </style>
</head>
<body>
   
    <div class="container">
        <ul>
            <li>
                <a href="#">
                    <img src="./1.png" alt="">
                    <div class="text">
                        <span class="name">魅族 18</span>
                        <span class="desc">限时领券最高立省1000 | 12期免息</span>
                        <span class="price"><i>¥</i>3900<em>起</em></span>
                    </div>
                    <span class="product-sign">免息</span>
                </a>
            </li>
            <li>
                <a href="#">
                    <img src="./1.png" alt="">
                    <div class="text">
                        <span class="name">魅族 18</span>
                        <span class="desc">限时领券最高立省1000 | 12期免息</span>
                        <span class="price"><i>¥</i>3900<em>起</em></span>
                    </div>
                    <span class="product-sign">免息</span>
                </a>
            </li>
            <li>
                <a href="#">
                    <img src="./1.png" alt="">
                    <div class="text">
                        <span class="name">魅族 18</span>
                        <span class="desc">限时领券最高立省1000 | 12期免息</span>
                        <span class="price"><i>¥</i>3900<em>起</em></span>
                    </div>
                    <span class="product-sign">免息</span>
                </a>
            </li>
            <li>
                <a href="#">
                    <img src="./1.png" alt="">
                    <div class="text">
                        <span class="name">魅族 18</span>
                        <span class="desc">限时领券最高立省1000 | 12期免息</span>
                        <span class="price"><i>¥</i>3900<em>起</em></span>
                    </div>
                    <span class="product-sign">免息</span>
                </a>
            </li>
        </ul>
    </div>
</body>
</html>

.container ul li{

            position: relative;

}这里面的position一定要用relative相对定位吗?

WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 338楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5基础元素 340楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/前端入门与基础知识 341楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5新增元素 343楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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