【问题标题】:Style embedded Instagram Photos horizontally水平样式嵌入 Instagram 照片
【发布时间】:2018-02-25 03:03:41
【问题描述】:

我很难为嵌入的 Instagram 照片添加简单的样式。我想要并排的照片,所以我使用了一个无序列表并对其进行了样式设置,因此它没有项目符号并水平列出它们。然而,这种风格似乎并不适用于嵌入的 Instagram 照片。

CSS

#instapost ul
{
list-style-type: none;
}

#instapost ul li { 
display: inline;
}

HTML

<div id="instapost">
<ul>
    <li>(copy any post from instagram and make max-width=320)</li>
    <li>(copy any post from instagram and make max-width=320)</li>
</ul>
</div>

可以在此处查看嵌入 Instagram 照片的完整示例: https://jsfiddle.net/edwardgam/0k7smgvk/4/

(我实际上使用的是 WordPress 和 WordPress 插件“简单的 Instagram 嵌入”,所以我只需复制 Instagram 照片的 URL(而不是 Instagram 提供的嵌入代码)并粘贴到我的 Wordpress 帖子中的适当位置。但是,无论我是否使用插件,这个问题都存在)。

谢谢。

【问题讨论】:

    标签: css instagram embed


    【解决方案1】:
    #instapost ul li { 
        width: 320px;
        float: left;
        margin-right: 10px;
    }
    

    【讨论】:

    • 谢谢瑞恩。这实际上非常有效。但我没有提到在此之后还有其他元素,它似乎弄乱了其他项目的格式。我所做的是添加一个新的 CSS #instapost-clear { clear: left; } Then called it after each div i.e.
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-27
    相关资源
    最近更新 更多