点击查看html编辑器说明文档

合作伙伴edit icon

|
|
Fork(复制)
|
|
作者:
dongua

👉 新版编辑器已上线,点击进行体验吧!

BUG反馈
嵌入
设置
下载
HTML
格式化
支持Emmet,输入 p 后按 Tab键试试吧!
<head> ...
展开
</head>
<body>
            
            <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>WD partners</title>
    <style>
        html, body {
            margin: 0;
            padding: 0;
            background: #f2f3f5;
            overflow: auto;
        }

        body {
            display: grid;
            grid-template-columns: repeat(12, 100px);
            grid-auto-rows: 100px;
            place-content: center;
            gap: 6px;
            height: 100vh;
        }

        .photo-item {
            width: 200px;
            height: 200px;
            clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
        }

    </style>
</head>
<body>

</body>
<script>
    let row = 1;
    let col = 1;
    for (let i = 0; i < 28; i++) {
        const div = document.createElement('div');
        div.className = 'photo-item';
        div.innerHTML = "<img src='https://picsum.photos/200/300?random="+i+"'' />";
        div.style.gridRow = `${row} / ${row + 2}`;
        div.style.gridColumn = `${col} / ${col + 2}`;

        document.body.appendChild(div);
        col += 2;
        if (col > 11) {
            row += 1;
            col = row % 2 === 0 ? 2 : 1;
        }
    }
</script>
</html>

        
编辑器加载中
</body>
CSS
格式化
            
            
        
编辑器加载中
JS
格式化
            
            
        
编辑器加载中
预览
控制台