Mahee
Mahee

Reputation: 141

'display: inline-flex' property not working in safari browser

i want align 20+ images in single line (horizontal manner). 'inline-flex' property working in Firefox and chrome expect safari.

<div class="rl-collection-img content" >
        <div class="rl-images_container">
            <img alt="" src="/staticassets/images/home/collections/blue/1.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/2.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/3.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/4.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/5.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/6.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/7.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/8.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/9.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/10.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/11.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/12.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/15.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/16.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/17.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/18.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/19.jpeg" />
            <img alt="" src="/staticassets/images/home/collections/blue/20.jpeg" />
        </div>
    </div>
<style>
.content{
    width:100%;
}
.rl-images_container{
    display: inline-flex;
}

Upvotes: 14

Views: 36009

Answers (4)

sony litt
sony litt

Reputation: 61

use for main container

white-space: nowrap; 
width: auto; 

use for items

display:inline-block;

Upvotes: 6

ninjaPixel
ninjaPixel

Reputation: 6382

Not all browsers fully support this property. Try this CSS for added support:

.flex-container {
        display: -webkit-box;      /* iOS 6-, Safari 3.1-6 */
        display: -moz-box;         /* Firefox 19 */
        display: -ms-flexbox;      /* IE 10 */
        display: -webkit-flex;     /* Chrome */
        display: flex;             /* Opera 12.1, Firefox 20+ */
}

.flex-item {
        -webkit-box-flex: 1;      /* iOS 6-, Safari 3.1-6 */
        -moz-box-flex: 1;         /* Firefox 19- */
        -webkit-flex: 1;          /* Chrome */
        -ms-flex: 1;              /* IE 10 */
        flex: 1;                  /* Opera 12.1, Firefox 20+ */
}

Upvotes: 1

Manish Champsee
Manish Champsee

Reputation: 465

There's a browser specific extension on inline-flex. You need to do:

display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;

Upvotes: 36

Krish
Krish

Reputation: 1894

use this code

.content{
    width:800px;
}
.rl-images_container{
    width: auto;
}
.rl-images_container img{
    width:30px;
    float:left;
}

Fiddle :http://jsfiddle.net/nikhilvkd/p6LKy/1/

Upvotes: 1

Related Questions