仿Instagram风格的图片瀑布流留言墙代码

唯美留言板代码唯美留言板代码 2026-01-04
仿Instagram风格的图片瀑布流留言墙代码

仿Instagram风格的图片瀑布流留言墙代码

这种风格强调视觉冲击,将留言以卡片形式展示,支持图片上传(模拟),布局采用CSS Grid或Flexbox实现的瀑布流。

Sunset vibes
Purple dream
Fresh start
Morning coffee
点击查看CSS Grid瀑布流代码
<style>
    .insta-wall { max-width: 800px; margin: 0 auto; background: #fafafa; padding: 20px; }
    .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
    .card { 
        background: #fff; border: 1px solid #dbdbdb; border-radius: 8px; overflow: hidden; 
        transition: transform 0.2s; cursor: pointer;
    }
    .card:hover { transform: scale(1.02); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
    .img-placeholder { height: 150px; background: linear-gradient(45deg, #ff9a9e, #fad0c4); }
    .card:nth-child(2n) .img-placeholder { background: linear-gradient(45deg, #a18cd1, #fbc2eb); height: 200px; }
    .card:nth-child(3n) .img-placeholder { background: linear-gradient(45deg, #84fab0, #8fd3f4); height: 120px; }
    .info { padding: 10px; font-size: 12px; color: #555; }
    .input-row { margin-top: 20px; display: flex; gap: 10px; align-items: center; border-top: 1px solid #efefef; padding-top: 15px; }
    .input-row input { flex: 1; padding: 8px; border-radius: 20px; border: 1px solid #dbdbdb; outline: none; }
    .input-row button { background: #0095f6; color: white; border: none; padding: 8px 15px; border-radius: 6px; font-weight: bold; cursor: pointer; }
    .input-row button:disabled { background: #b3e0fb; }
</style>

<div class="insta-wall">
    <div class="grid" id="wallGrid">
        <!-- 初始卡片 -->
        <div class="card"><div class="img-placeholder"></div><div class="info">Beautiful day</div></div>
        <div class="card"><div class="img-placeholder"></div><div class="info">City lights</div></div>
    </div>
    
    <div class="input-row">
        <input type="text" id="caption" placeholder="写下此刻心情...">
        <button onclick="addPost()">发布</button>
    </div>
</div>

<script>
    function addPost() {
        var txt = document.getElementById('caption').value;
        if(!txt) return;
        var grid = document.getElementById('wallGrid');
        var card = document.createElement('div');
        card.className = 'card';
        // 随机高度模拟图片
        var h = 120 + Math.floor(Math.random() * 100);
        card.innerHTML = `<div class="img-placeholder" style="height:${h}px"></div><div class="info">${txt}</div>`;
        grid.appendChild(card);
        document.getElementById('caption').value = '';
    }
</script>
        
精选评论
  • 赤色月光:106.89.170.234
    補記仲係讀書時候睇嘅經典之作烚下烚下  仿Instagram风格的图片瀑布流留言墙代码
  • 环游发光睡裤:139.202.120.180
    这季尾收的太工整仿Instagram风格的图片瀑布流留言墙代码没有弄大事件真好奇第6季怎么开头 仿Instagram风格的图片瀑布流留言墙代码
  • Phoebe的情书:121.76.190.87
    这种片子得是阅碟颇多的人才能看懂 搞笑啊 哈哈  仿Instagram风格的图片瀑布流留言墙代码
  • 惟勤Heart:222.83.163.64
    拍得很好看浓墨重彩的表现风格 疤面煞星不知道是不是从这片来的灵感写一个人如何走向灵魂的深渊 最好的故事感觉没有讲完仿Instagram风格的图片瀑布流留言墙代码可能是觉得无论是谁杀死谁都不够高级吧 我倒是喜欢他不被杀死一个不死的恶魂就很带劲  仿Instagram风格的图片瀑布流留言墙代码
  • 捕雨:36.58.144.126
    董永太太太丑了 杨子好好的商人干嘛非要出来演戏辣眼睛 他俩算是公费谈恋爱黄圣依好美啊  仿Instagram风格的图片瀑布流留言墙代码
🆕 New