2022/1/13 css复习,JS上下文

2022-01-13  本文已影响0人  前端不许笑

写在前头

在我决定走前端时,大概是21年暑假,那时参加了学校的ACM集训,在坚持了一个暑假期间,我也认识到自己不是“小镇做题家” 。当然也没那做题的脑子。 之前都是一直偶尔兴趣来了学学前端。

大一折腾了很多其他的玩意(钱,嘻嘻嘻),也赚到没几个硬币。现在大二开始好好准备春招。每天公众号打卡,没人看也无所谓。

春招倒计时

image.png

每日小结

有效学习时间

8h

学习内容

今天复习了css部分视频知识,定位,精灵图,显示隐藏三角形制作等等。

目前水平

HTML,CSS:看了某马的html,css网课,全敲完了一遍。菜鸟教程也看了一遍。

JavaScript:还在上着某马的课

粗糙笔记

代码粗糙笔记 -- 知道自己每天学了啥就行,哈哈哈。

//01-相对定位

<style>
        .box1 {
            position: relative;
            top: 100px;
            left: 100px;
            width: 200px;
            height: 200px;
            background-color: pink;
        }
        .box2 {
            width: 200px;
            height: 200px;
            background-color: deeppink;
        }
    </style>
</head>
<body>
    <div class="box1">

    </div>
    <div class="box2">

    </div>
    
</body>
//02-绝对定位-父级无定位
<style>
        .father {
            width: 500px;
            height: 500px;
            background-color: skyblue;
        }
        .son {
            position: absolute;
            /* top: 10px;
            left: 10px; */
            /* top: 100px;
            right: 200px; */
            left: 0;
            bottom: 0;
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <div class="father">
            <div class="son"></div>
    </div>
   
</body>
//绝对定位-父级有定位
 <style>
        .yeye {
            position: relative;
            width: 800px;
            height: 800px;
            background-color: hotpink;
            padding: 50px;
        }
        .father {
          
            width: 500px;
            height: 500px;
            background-color: skyblue;
        }
        .son {
            position: absolute;
            left: 30px;
            bottom: 10px;
            width: 200px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>
<body>
    <div class="yeye">
            <div class="father">
                    <div class="son"></div>
            </div>
    </div>
   
   
</body>
//固定定位
 <style>
        .dj {
            position: fixed;
            top: 100px;
            left: 40px;
        }
    </style>
</head>
<body>
    <div class="dj">
        <img src="images/pvp.png" alt="">
    </div>
    <p>请尽情吩咐妲己,主人</p>
    </div>
   </body>
上一篇 下一篇

猜你喜欢

热点阅读