New year is coming and I want to wish all of you Happy Holidays. For this reason, I made a little CSS3 experiment (with absolutely no images) and I hope you’ll enjoy it.
Below you have the demonstration, you may take a look or you can follow the step-by-step tutorial:
The HTML is quite minimal, we have a div that wraps all the elements.
Further you’ll see that this experiment it’s based on pseudo-elements as-well. This is very helpful when you want less HTML code for your website/web application.
The Background
As you notice if you’re using Firefox or Chrome, the background it’s a pattern made with gradients. The new stuff is background-size property (with its prefixes for various browsers) when defining CSS gradients.
In this case, the background-size adjust the size of the stripes.
Look Mom! No images!
Wrapper
Further you need to add the wrapper within which you’ll draw all the other elements.
The last rule it’s for adding a snowflake to our design without extra HTML markup.
Let’s add some snow
Below you can see how it’s made: by overlapping three huge (2000x2000 px) circles. If you’ll remove overflow: hidden from the #wrapper selector you’ll see the circles full-size.
One more thing to add and the design it’s done. Let’s create the fir tree using CSS triangle shapes. This is not CSS3, but it’s cool anyway :).
Final result
In order to see the demo in the right way, note please that you should use one of the following browsers: Firefox, Chrome, Safari. The demo looks OK on Opera and IE9, but without gradients.
Happy Holidays
Enjoy your Holidays and let’s hope the next year will be a better one for all of us. See you next year!