.conjunto div {
width: 150px;
height: 100px;
margin-left: 5px;
float: left;
}
.conjunto div:nth-child(1) {
background: #00ff00; /* Old browsers */
background: -moz-linear-gradient(top, #00ff00 0%, #ffff00 50%, #0000ff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00ff00), color-stop(50%,#ffff00), color-stop(100%,#0000ff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #00ff00 0%,#ffff00 50%,#0000ff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #00ff00 0%,#ffff00 50%,#0000ff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #00ff00 0%,#ffff00 50%,#0000ff 100%); /* IE10+ */
background: linear-gradient(to bottom, #00ff00 0%,#ffff00 50%,#0000ff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ff00', endColorstr='#0000ff',GradientType=0 ); /* IE6-9 */;
}
.conjunto div:nth-child(2) {
background: #0000ff; /* Old browsers */
background: -moz-linear-gradient(left, #0000ff 0%, #ffff00 50%, #00ff00 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#0000ff), color-stop(50%,#ffff00), color-stop(100%,#00ff00)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #0000ff 0%,#ffff00 50%,#00ff00 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #0000ff 0%,#ffff00 50%,#00ff00 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #0000ff 0%,#ffff00 50%,#00ff00 100%); /* IE10+ */
background: linear-gradient(to right, #0000ff 0%,#ffff00 50%,#00ff00 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0000ff', endColorstr='#00ff00',GradientType=1 ); /* IE6-9 */;
}
.conjunto div:nth-child(3) {
background: #0000ff; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #0000ff 0%, #ffff00 50%, #00ff00 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#0000ff), color-stop(50%,#ffff00), color-stop(100%,#00ff00)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #0000ff 0%,#ffff00 50%,#00ff00 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #0000ff 0%,#ffff00 50%,#00ff00 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #0000ff 0%,#ffff00 50%,#00ff00 100%); /* IE10+ */
background: radial-gradient(ellipse at center, #0000ff 0%,#ffff00 50%,#00ff00 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0000ff', endColorstr='#00ff00',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */;
}
<div class='conjunto'>
<div></div>
<div></div>
<div></div>
</div>
That sounds like homework question :P
– Sergio
Hahaha, it’s a recurring question for Google paratroopers :)
– Paulo
And it’s still a semi-duplicate http://answall.com/questions/32800 :P - the colours of the flag of Portugal have yet to be made :)
– Bacco
@Bacco I had even searched before but had not seen this, lucky that your link asks solution in Javascript :P
– Paulo
Although the duplicate is considered more by the answers, even if the question is a little different. But as yours is more complete, I think you can only consider "semi" duplicate even, mainly by using more colors and shapes. (so probably none of the visitors will want to vote to close :).
– Bacco