• 静态页面复习--CSS定位练习1


    .block-1 {
    
        box-sizing: border-box;
        width: 64px;
        height: 64px;
        background:url('images/grass.png');
        background-size: contain;
        position: absolute;
        left:64px;
    }
    
    .block-2 {
        box-sizing: border-box;
        width: 128px;
        height: 64px;
        background:url('images/grass.png');
        background-size: contain;
    }
    
    .block-3 {
    
        box-sizing: border-box;
        width: 192px;
        height: 64px;
        background:url('images/grass.png');
        background-size: contain;
        position: relative;
        left:64px;
    }
    
    .flower {
        box-sizing: border-box;
        width: 64px;
        height: 64px;
        background:url('images/rose.png');
        background-size: contain;
        position: relative;
        left: 128px;
    }
    
    .yellow-flower {
        box-sizing: border-box;
        width: 64px;
        height: 64px;
        background:url('images/flower.png');
        background-size: contain;
        position: relative;
        left: 128px;
    
    }
    
    .point {
        width: 8px;
        height: 8px;
        background: rgb(255, 176, 0);
    }
    
    .bg {
        border: solid 8px rgb(210, 157, 65);
        background: rgb(36, 130, 255);
        width: 320px;
        height: 256px;
        position: absolute;
        left: 50%;
        top:50%;
        transform: translate(-50%,-50%);
    }
    
    body {
        margin: 0;
        background: url('images/brick.jpg');
        background-size: 150px 150px;
    }
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title>Learn css with blocks</title>
            <link rel="stylesheet" href="block.css" media="screen" title="no title" charset="utf-8">
        </head>
        <body>
    
            <div class="bg">
                <div class="yellow-flower">
                    <div class="point">
    
                    </div>
                </div>
    
    
                <div class="block-3"></div>
                <div class="block-1"></div>
                <div class="block-1" style="left:192px;"></div>
                <div class="flower">
                 <div class="point">
                 </div>
                </div>
    
                <div class="block-3"></div>
    
            </div>
    
    
    
        </body>
    </html>

  • 相关阅读:
    如何更改VS2005调试网站的浏览器类型
    StringBuilder 的 Capacity属性
    Convert.ToInt32,Int32.Parse和Int32.TryParse的关系
    今天第一天注册
    关于Random产生随机数测试
    [导入]Reporting Services 4: Web Service
    [导入]Reporting Services 5: Extensions & Custom Report Item
    silverlight缓存无法更新的简易解决办法
    总结前段时间做的电话业务故障处理系统(1)
    atlas
  • 原文地址:https://www.cnblogs.com/xyxpython/p/6178490.html
Copyright © 2020-2023  润新知