2016-02-13 3 views
1

У меня есть страница, где я вставляю несколько сообщений Instagram. Все сообщения встроены через эту функцию, если вы видите изображение и нажмите на правый нижний угол на «Вставить это».Встраиваемый стол Instagram с описанием: одинаковые высоты?

Я изменил ширину на 350 пикселей.

Я искал responsive instagram embed и нашел что-то для вставки одного сообщения.

Может кто-нибудь проверить эту скрипку и объяснить мне, что случилось? :(

Спасибо заранее

https://jsfiddle.net/ouqg0wj7/

Код:

.row .col-sm-4 iframe { 
 
    max-width: 350px; 
 
    min-height: 100%; 
 
}
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 
 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> 
 
<div class="row"> 
 
    <div class="col-sm-4"><blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="6" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:350px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50.0% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div></div> <p style=" margin:8px 0 0 0; padding:0 4px;"> <a href="https://www.instagram.com/p/_h7TJTEIfv/" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">S M I L E #bemarvelous #marvelousproducts #marvelousbeauty #beauty #style #hair #product #men #women #lovely #hairdresser #hairdesign #allblack #stylist #instyle #vogue #paris #moscow #milan #london #newyork #lissabon #berlin #stuttgart #germany #italy #russia #portugal #picoftheday #picture</a></p> <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">Ein von @melo_modica gepostetes Foto am <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2015-12-20T22:17:57+00:00">20. Dez 2015 um 14:17 Uhr</time></p></div></blockquote></div> 
 
    <div class="col-sm-4"><blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="6" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:350px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50.0% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div></div> <p style=" margin:8px 0 0 0; padding:0 4px;"> <a href="https://www.instagram.com/p/_WgapQQeNY/" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">My sweet brother @andreeeiiiii #mybrother #blogger #bloggers #blogging #howilovehim #whatuseeiswhatuget #larissssssssssssa #bemarvelous #beyourself #staystrong #dowhatsbestforyou</a></p> <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">Ein von Lrissa (@larissssssssssssa) gepostetes Foto am <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2015-12-16T11:51:24+00:00">16. Dez 2015 um 3:51 Uhr</time></p></div></blockquote></div> 
 
    <div class="col-sm-4"><blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="6" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:350px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:62.5% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div></div> <p style=" margin:8px 0 0 0; padding:0 4px;"> <a href="https://www.instagram.com/p/-y0E9vr9-E/" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">MARVELOUS ❤️#marvelous #bemarvelous #hair #salon #salondeluxe #haircolor #hairstyle #hairstylist #follow4follow #follower #follow #followme #instagood #instalike #likes #lfl#look #happy #beautiful #girl#emelüstün #me#selfie #keratin #volume #shine #glanz #love</a></p> <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">Ein von Emel Üstün (@emelim82) gepostetes Foto am <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2015-12-02T15:10:33+00:00">2. Dez 2015 um 7:10 Uhr</time></p></div></blockquote></div> 
 
</div> 
 

 
<script async defer src="//platform.instagram.com/de_DE/embeds.js"></script>

Последний вопрос: Как получить этот результат Expected result Из текущего кода? Current code result

+0

В чем вопрос? И разместите свой код здесь тоже –

+0

@DarrenSweeney: Я добавил недостающие детали. Благодаря! – Patrick

ответ

1

К сожалению, вы не можете. Можно сделать iframes Instagram одинаковой высоты (используя display: table-cell; или JS), но он не будет выглядеть так, как вы хотите.

Демо: https://jsfiddle.net/ouqg0wj7/3/

Вам потребуется доступ к Instagram встраивать CSS, чтобы исправить это.

Возможно, вы вместо этого можете использовать Masonry или CSS columns?

+0

Хм спасибо за ваш ответ. Завтра я попробую эту масонскую штуку, но я надеюсь, что есть еще одно решение, которое лучше :) http://www.bloggerever.com/2014/06/how-to-create-masonry-based-instagram.html – Patrick

+1

Нет проблем , удачи. (не могли бы вы отменить голосование на мой ответ, если бы это было полезно? спасибо!) –

+0

Или есть другое решение для вставки сообщений instagram? Моя мысль - это php-прокси для iframe, чтобы добавить пользовательский код css :) Но не знаю, разрешено ли и как меняться ... Я думаю, что его JavaScript, который я должен изменить, тоже. Не знаю, как Instagram выглядит так: D – Patrick

Смежные вопросы