发表于: 2020-06-25 21:25:58

1 1192


今天完成的事情:

了解了css制作胶囊导航栏

了解了css制作轮播图的两种方法


1.html:

            <nav class="navbar">
                <div class="nav-box">
                    <input type="checkbox" id="nav-toggle">
                    <label for="nav-toggle">
                        <img src="./images/src/jnshu按钮.jpg" style="width: 3rem;height: 3rem;">
                    </label>
                    <ul class="nav-list">
                        <li>
                            <a href="#">关于</a>
                        </li>
                        <li>
                            <a href="#">菜单二</a>
                        </li>
                        <li>
                            <a href="#">菜单三</a>
                        </li>
                    </ul>
                </div>
            </nav>


css:

            .navbar {
                background-colorgreen;
                width100%;
                height6rem;
            }

            .nav-box {
                text-alignright;
                width90%;
                margin0 auto;
            }

            input {
                displaynone;
            }

            label {
                displaynone;
            }

            .nav-list {
                margin0;
                padding0;
                displayflex;
                flex-directionrow-reverse;
                line-height6rem;
            }

            li {
                font-size1.3rem;
                list-stylenone;
                margin-bottom4px;
                margin-left3rem;
                line-height5.6rem;
                padding-left1rem;
                padding-right1rem;
            }

            li:hover {
                border-bottom4px solid white;
                margin-bottom0;
            }

            a {
                text-decoration-linenone;
                color#fff;
            }

            @media screen and (max-width:767px) {
                .nav-list {
                    displaynone;
                }

                input:checked~.nav-list {
                    displayblock;
                }

                label {
                    displayinline-block;
                    margin1.3rem 1rem;
                }

                input:checked~li {
                    clearboth;
                    displayflex;
                    flex-directioncolumn;
                    align-itemscenter;
                }

                .navbar {
                    background-colorgreen;
                    width100%;
                    heightauto;
                }
            }


2.轮播图资料资料:https://blog.csdn.net/weixin_42276859/article/details/80648944

分为自动轮播和手动轮播,目前未发现css有可以将两种轮播效果结合起来的代码


明天的计划:

完成任务14第1,2页


返回列表 返回列表
评论

    分享到