Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


How to make browser specific styles?

Hey guys, I have a question that I am trying to work out currently. I need to make browser specific styles for Flex Box. You can view my site at shawweb.designs/pj. I am using the Flexbox to design the webpage and in older IE browsers and all mobile browers the flex boxes act very differently than my desktop on Chrome. I've tried a few different things in the CSS, but cannot manage to target JUST IE browsers, or just mobile (webkit) browsers. Please, any help is appreciated!

1 Answer

Julian Gutierrez
Julian Gutierrez
19,201 Points

Have you tried Modernizr? I do believe Modernizr can "detect" browsers that are not compatible with flexbox and give you a class to apply targeted CSS to. https://modernizr.com/

I was trying to use that, and I either don't understand or it's not working for me right :/ it still collapses the flex boxes and makes them act weird. I'll keep trying. Thank you!