2017-02-11 4 views
1

Этот самозагрузки 4 кодSafari и Bootstrap 4 - автоматическая сетка разбивает

<div class="container-fluid"> 
    <div class="row"> 
     <div class="col"><small>Some text here</small></div> 
     <div class="col"><small>Some text here</small></div> 
     <div class="col"><small>Some text here</small></div> 
     .... add more columns until they should wrap 
     <div class="col"><small>Some text here</small></div> 
     <div class="col"><small>Some text here</small></div> 
    </div> 
</div> 

автоматически завернуть в Chrome и Firefox так же, как ожидалось. Однако в сафари он не будет переноситься в следующую строку, но выходит за пределы полей страницы.

Есть ли работа вокруг?

Обратите внимание, что в зависимости от ширины вашего видового экрана вы должны добавить кучу <div class="col"><small>Some text here</small></div>, чтобы эффект был видимым.

+0

Это может быть полезно, чтобы добавить это в качестве вопроса https://github.com/twbs/bootstrap/issues – Thilo

+0

@Armin добавил вопрос: https://github.com/twbs/bootstrap/issues/21967 – ZimSystem

ответ

0

Вы можете попробовать использовать flexbox вместо этого, например.

<div class="container-fluid"> 
    <div class="row"> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
     <div class="d-flex p-2"><small>Some text here</small></div> 
    </div> 
</div> 

См. this fiddle. Это может или не может достигнуть того, что вам нужно - вы, вероятно, можете настроить его, поддержка Bootstrap 4 flex довольно эффективна, так как alpha6.

http://v4-alpha.getbootstrap.com/utilities/flexbox/

+1

Но я думал, что flex всегда активен в B4? –

+0

Ну, вы попросили обходной путь, и это может сработать :) Я думаю, вы, по сути, просто обнаружили ошибку, связанную с Safari, поскольку вы правы, что ваша версия * должна * работать. – Thilo

+0

Я попробую. Я также узнал, что есть специальные классы упаковки, которые я мог бы попробовать. Тем не менее, я думаю, что это крошечный недостаток (в Safari или BT) –

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