המאפיין justify-items
מגדיר כיצד ליישר את התוכן בתוך כל תא של Grid על ציר הרוחב.
start
- ליישר את התוכן להתחיל מהקצה השמאלי של התא.end
- ליישר את התוכן להתחיל מהקצה הימני של התא.center
- ליישר את התוכן במרכז התא.stretch
- למתוח את התוכן כדי למלא את התא.להלן דוגמה לשימוש במאפיין justify-items
:
<style>
.container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.item {
background-color: lightcoral;
padding: 20px;
text-align: center;
justify-items: center;
}
</style>
<div class="container">
<div class="item">אלמנט 1</div>
<div class="item">אלמנט 2</div>
<div class="item">אלמנט 3</div>
</div>
רק רגע