9
I have a class circulo
with various properties: source and shape, etc
and I have another class circulo1
with the property size and color.
I have to make several circles of different sizes with the same color and in several different places on the page. However, I cannot get the circle class to receive all the properties of the circle class.
.circulo{
color:#fff;
line-height:300px;
vertical-align:middle;
text-align:center;
font-size:30px;
border-radius:50%;
-moz-border-radius:50%;
-webkit-border-radius:50%;
margin: 10px;
float: left;
}
.circulo1 .circulo{
background:red;
width:280px;
height:280px;
}
.circulo2 .circulo{
background:blue;
width:280px;
height:280px;
}
.circulo3.circulo{
background:red;
width:280px;
height:280px;
}
.circulo4.circulo{
background:blue;
width:280px;
height:280px;
}
.circulo5.circulo{
background:red;
width:280px;
height:280px;
}
.circulo6.circulo{
background:blue;
width:280px;
height:280px;
}
#bloco1{
margin-left: 0%;
}
#bloco2{
margin-left: 20%;
}
#bloco3{
margin-left: 40%;
}
<div id="bloco1">
<div id="1" class="circulo circulo1"> Tidbits1</div>
<div id="2" class="circulo circulo2">Tidbits2 </div>
</div>
<div id="bloco2">
<div id="3" class="circulo1"> Tidbits3</div>
<div id="4" class="circulo2">Tidbits4 </div>
</div>
<div id="bloco3">
<div id="5" class="circulo1"> Tidbits5</div>
<div id="6" class="circulo2">Tidbits6 </div>
</div>
Can you show your HTML? It would be ideal to see this in a jsFiddle to understand it better. Please correct the question: "with which the circle class receives all the properties of the circle class" there is one missing
1
nay?– Sergio
You’re right...looks better on jsFiddle: http://jsfiddle.net/alexjosesilva/2tfpq8eh/
– alexjosesilva
I guess instead of
.circulo1.circulo
should just be.circulo1
once the HTML hasclass="circulo circulo1"
. So => http://jsfiddle.net/2tfpq8eh/1/– Sergio