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

Susan Siow
Susan Siow
6,497 Points

Background-Size CSS on Opera Mini

Does Opera Mini not recognize background-size: cover? If not, how can I hide the background image from displaying on the Opera browser?

Your suggestions are greatly appreciated, thank you!

link

3 Answers

There's only one browser out there that's worse than IE7/8 in terms of support for modern features, and that's Opera Mini. As this page on caniuse.com says, Opera Mini does not support background sizing, unfortunately.

Fortunately, and unlike IE, Opera Mini isn't used on that many devices. Opera in general isn't popular at all, and Opera Mini even less so. I know it's the default browser on the Wii, and that you can download it for mobile devices. But that's about it.

Speaking of caniuse.com, it's really a great place to check to see if a browser supports certain features. Just type in a feature you want to search for at the top or choose from the list they provide. It's another arrow in my developer quiver, and one that I use quite frequently.

Also, nice site. A very clean and open design.

EDIT: Modernizr can help you with the second part to your question. It's a JavaScript library that checks browser support for certain features, including CSS3 stuff like flexbox, animations, transitions, and also background sizing. If it detects that a browser can support a certain feature (flexbox, for instance), it will add a corresponding class to the html element (in the case of flexbox, .flexbox). If the browser doesn't support the feature, it adds a negative class--.no-flexbox, in the case of flexbox.

To get Modernizr, go to their download page and configure what features you want to test for. Don't go for everything, as that will really slow down your site. Only go for the things you need or might need eventually. Make sure to get the HTML5 Shiv included as well. After that, download your build and include it in your head element. Usually, such a thing is not advised, but Modernizr is an exception to that rule of thumb.

Happy coding!

James Barnett
James Barnett
39,199 Points

> Opera in general isn't popular at all, and Opera Mini even less so

Depends where your user base is, Opera on Mobile devices has historically dominated the mobile space in the developing world.

With the rise of Android those stats are changing and with that change Opera Mobile has moved to webkit.

However, in Africa Opera still dominates the mobile space and Opera Mini is probably a large chunk of that.

But the vast, vast majority of web traffic still comes from North America and, to a lesser extent, from Europe and Asia. Globally/generally speaking, my statement holds true.

I'm actually interested to see how Firefox OS fares in developing countries. Most Americans might blow it off, but people in those poorer countries will like it, I bet.

Also, good catch on the caniuse page. I skimmed over it and saw "Partial support in Opera Mini refers to not supporting background sizing" and thought "Great, got what I came for."

James Barnett
James Barnett
39,199 Points

> vast, vast majority of web traffic still comes from North America and, to a lesser extent, from Europe and Asia

A significant number of the world's Internet users come from: China, Japan, India & Brazil in addition to the US.

source: https://en.wikipedia.org/wiki/List_of_countries_by_number_of_Internet_users

Susan Siow
Susan Siow
6,497 Points

Ryan Duchene Many thanks for the light and compliment! I will try Modernizr, hope it can be well blended with a Wordpress framework. Happy weekend! :)

James Barnett
James Barnett
39,199 Points

"Partial support in Opera Mini refers to not supporting background sizing or background attachments. However Opera Mini 7.5 supports background sizing (including cover and contain values)."

from: http://caniuse.com/#search=background-size

I should be noted that since version 14, Opera and Opera Mobile change their engine to webkit, however Opera Mini has stayed with the Presto engine.

Susan Siow
Susan Siow
6,497 Points

Thanks for the Can I Use link! It will be very useful for my future web development. Thanks again!

Patrick Donahue
Patrick Donahue
9,523 Points

I don't have an answer, but you have a really nice site! I look forward to trying some of the recipes on there!

Susan Siow
Susan Siow
6,497 Points

Thank you for the great moral support! Have a splendid weekend!