Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Unused CSS Stages Flexbox and Multi-Column Layout Flexbox: Part 2

Shane McC
Shane McC
3,005 Points

Is webkit supported by IE and Firefox? The reason why I ask is because I open my local URL in my firefox and IE browsers

Is webkit supported by IE and Firefox? The reason why I ask is because I open my local URL in my firefox and IE browsers my layout isn't displaying properly. Perhaps I'm doing something wrong?

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

No webkit is Safari and Chrome. IE is MS and Firefox is MOZ.

http://webdesign.about.com/od/css/a/css-vendor-prefixes.htm

Shane McC
Shane McC
3,005 Points

Thanks Kevin,

I'm confident I know the next answer to my question but I'm going to ask it anyway. In order to use webkits correctly in IE, MS, Firefox, Opera etc... I would need multiple stylesheets?

I've tried the below syntax in Safari. For me, it's not working. Is this syntax working for anyone else?

.nav, .main {
    display: -webkit-flex;
    display: -ms-flex;
    display: -moz-flex;
}

.nav {
    -webkit-flex-direction: row;
    -webkit-justify-content: space-between;
    -webkit-flex-wrap: wrap;
}

.nav li {
    -webkit-flex-grow: 1;
}

.col {
    -webkit-flex: 1;
}

.col-c {
    -webkit-flex: 2;
    -webkit-order: -1;
}

@media screen adnd (max-width: 99px) {
    .main {
        -webkit-flex-direction: column;
    }
}

/*.col-b {
    -webkit-align-self: stretch;
}*/

/*.nav, .main {
    display: -webkit-flex;
}

.nav {
    -webkit-flex-direction: row;
    -webkit-justify-content: space-between;
    -webkit-flex-wrap: wrap;
}

.nav li {
    -webkit-flex-grow: 1;
}

.col {
    -webkit-flex: 1;
}

.col-c {
    -webkit-flex: 2;
    -webkit-order: -1;
}

@media screen and (max-width: 999px) {
    .main {
        -webkit-flex-direction: column;
    }
}
*/
<!DOCTYPE html>
<html>
<head>
    <title>Flexbox</title>
    <link rel="stylesheet" href="css/page-styles2.css">
    <link rel="stylesheet" type="text/css" href="css/flexbox2.css">
</head>
<body>
    <ul class="nav">
        <li><a href="#">Item 1</a></li>
        <li><a href="#">Item 2</a></li>
        <li><a href="#">Item 3</a></li>
        <li><a href="#">Item 4</a></li>
        <li><a href="#">Item 5</a></li>
        <li><a href="#">Item 6</a></li>
    </ul>
    <div class="main">
        <div class="col-a col">
            <h2>Column A</h2>
            <p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent id mollis neque. Phasellus rutrum iaculis ante, id tincidunt tellus pulvinar vitae. Maecenas sodales mollis nisi sit amet congue. 
            </p>
        </div>
        <div class="col-b col">
            <h2>Column B</h2>
            <p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent id mollis neque. Phasellus rutrum iaculis ante, id tincidunt tellus pulvinar vitae.
            </p>
        </div>
        <div class="col-c col">
            <h2>Column C</h2>
            <p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent id mollis neque. Phasellus rutrum iaculis ante, id tincidunt tellus pulvinar vitae. Maecenas sodales mollis nisi sit amet congue. 
            </p>
            <p>
                Duis pharetra, sem in dictum posuere, justo orci vestibulum arcu, vitae lobortis ipsum nibh sed dolor. Vestibulum sodales pulvinar risus vel fermentum. Nunc sit amet eros eget orci euismod imperdiet. Phasellus scelerisque orci non ipsum vestibulum non eleifend.
            </p>
        </div>
    </div>
</body>
</html>
Kevin Korte
Kevin Korte
28,149 Points

Your layout was working in Chrome. You don't need multiple stylesheets, it can all go in one. Just like you did

.nav, .main {
    display: -webkit-flex;
    display: -ms-flex;
    display: -moz-flex;
}

Here is some ways to automatically deal with vendor prefixes: http://css-tricks.com/how-to-deal-with-vendor-prefixes/

My method is I use autoprefixer. It's a great tool and I don't think twice about them.