Good, I am making a design in css, it is practically a circle and inside the circle enter a number, the bad thing is that when I do it all the circles are downwards. I would like them to place the last image on the side
Here is the code in css
/* Círculos de colores numerados */
span.red {
background: red;
border-radius: 0.8em;
-moz-border-radius: 0.8em;
-webkit-border-radius: 0.8em;
color: #ffffff;
display: inline-block;
font-weight: bold;
line-height: 1.6em;
margin-right: 15px;
text-align: center;
width: 1.6em;
}
span.grey {
background: #cccccc;
border-radius: 0.8em;
-moz-border-radius: 0.8em;
-webkit-border-radius: 0.8em;
color: #fff;
display: inline-block;
font-weight: bold;
line-height: 1.6em;
margin-right: 15px;
text-align: center;
width: 1.6em;
}
span.green {
background: #5EA226;
border-radius: 0.8em;
-moz-border-radius: 0.8em;
-webkit-border-radius: 0.8em;
color: #ffffff;
display: inline-block;
font-weight: bold;
line-height: 1.6em;
margin-right: 15px;
text-align: center;
width: 1.6em;
}
span.blue {
background: #5178D0;
border-radius: 0.8em;
-moz-border-radius: 0.8em;
-webkit-border-radius: 0.8em;
color: #ffffff;
display: inline-block;
font-weight: bold;
line-height: 1.6em;
margin-right: 15px;
text-align: center;
width: 1.6em;
}
span.pink {
background: #EF0BD8;
border-radius: 0.8em;
-moz-border-radius: 0.8em;
-webkit-border-radius: 0.8em;
color: #ffffff;
display: inline-block;
font-weight: bold;
line-height: 1.6em;
margin-right: 15px;
text-align: center;
width: 1.6em;
}
HTML of the circles
<h1><span class="grey">1</span>Un circulo gris con un número interior</h1>
<h1><span class="red">2</span>Un circulo rojo con un número interior</h1>
<h1><span class="blue">3</span>Un circulo azul con un número interior</h1>
<h1><span class="green">4</span>Un circulo verde con un número interior</h1>
<h1><span class="pink">5</span>Un circulo rosa con un número interior</h1>
so when I run it I get this way
but I would like it to come out like this PF your help or what am I doing wrong
The problem is that h1, by default, most browsers render it with these values:
As you can see, it has the property
display:block
. Hence, each element is being shown to you as an entire block.One option is to change the
display
delh1
toinline
:Although you have to keep in mind that when you have a text next to the circle, it will skip lines, as you can see here:
If you only want to show the circles, it would look like this:
And you could even save yourself the
h1
and play around with the propertyfont-size
. I leave you this example with different sizes: