המאפיין grid-template-rows
מגדיר את מספר השורות בתבנית ה-Grid ואת גודל השורות.
repeat(count, size)
- חוזר על גודל השורה מספר פעמים.auto
- גודל אוטומטי לשורות.fr
- יחידת מידה המייצגת חלק יחסי מהשטח הזמין.להלן דוגמה לשימוש במאפיין grid-template-rows
:
<style>
.container {
display: grid;
grid-template-rows: repeat(2, 100px);
gap: 10px;
}
.item {
background-color: lightgreen;
padding: 20px;
text-align: center;
}
</style>
<div class="container">
<div class="item">אלמנט 1</div>
<div class="item">אלמנט 2</div>
</div>
רק רגע