Web前端之路程序员让前端飞

img标签随机获取高质量图片

2018-09-13  本文已影响292人  zhaoolee

开源图片api的使用

随机封面效果展示

随机封面测试地址(页面每次刷新,都能看到不同的封面): http://zhaoolee.com

页面部分源码:

<body>
    <section class="clearfix">
        <div class="item">
            <a href="http://git.zhaoolee.com">
                <img src="https://source.unsplash.com/300x300/?program" alt="">
                <div class="item-title">私有Git仓库</div>
            </a>
        </div>


        <div class="item">
            <a href="http://cloud.zhaoolee.com">
                <img src="https://source.unsplash.com/300x300/?document" alt="">
                <div class="item-title">私有云网盘</div>
            </a>
        </div>

        <div class="item">
            <a href="https://www.jianshu.com/u/c5d047065c42">
                <img src="https://source.unsplash.com/300x300/?book,library" alt="">
                <div class="item-title">简书主页</div>
            </a>
        </div>

        <div class="item">
            <a href="https://github.com/zhaoolee">
                <img src="https://source.unsplash.com/300x300/?github" alt="">
                <div class="item-title">Github主页</div>
            </a>
        </div>

        <div class="item">
            <a href="">
                <img src="https://source.unsplash.com/300x300/?cartoon" alt="">
                <div class="item-title">在线爬虫(建设中)</div>
            </a>
        </div>


        <div class="item">
            <a href="">
                <img src="https://source.unsplash.com/300x300/?beauty" alt="">
                <div class="item-title">资源分享(建设中)</div>
            </a>
        </div>
    </section>
</body>

小结:

上一篇 下一篇

猜你喜欢

热点阅读