Je fais un graphique, et je dois centrer aligner les textes absolus selon le parent, quelqu'un a une idée? Merci !Centre aligner le texte absolu dans un tableau
Edit: Je ne devrais pas modifier le code html ..
CSS : centering absolute positioned text inside relative parent> ne fonctionne pas sur la mise en page de table
.graph
{
width: 100%;
height: 400px;
display: table;
table-layout: fixed;
border-collapse: separate;
border-spacing: 15px;
font-family: arial;
}
.graph > div
{
display: table-cell;
vertical-align: bottom;
text-align: center;
}
.graph > div > div
{
animation: graph 0.5s ease-in-out;
background: #e74c3c;
}
.graph > div > span
{
position: absolute;
font-size: 12px;
color: black;
}
@keyframes graph
{
0%
{
height: 0%;
}
}
<div class="graph">
<div><div style="height:75%;"></div><span>Valeur 1</span></div>
<div><div style="height:100%;"></div><span>Valeur 2</span></div>
<div><div style="height:25%;"></div><span>Valeur 3</span></div>
<div><div style="height:85%;"></div><span>Valeur 4</span></div>
<div><div style="height:43%;"></div><span>Valeur 5</span></div>
<div><div style="height:65%;"></div><span>Valeur 6</span></div>
<div><div style="height:30%;"></div><span>Valeur 7</span></div>
</div>
Oh merci! :) –
Vous êtes les bienvenus :) – Chiller