Обратите внимание, что для div установлено значение display: flex
. Внутри есть несколько таблиц. Я не могу изменить высоту div так, чтобы она занимала 85% страницы без равномерного вытягивания таблиц внутри розового div.
Я пытаюсь равномерно распределить содержимое таблиц внутри div. Я не могу найти правильный набор правил, чтобы заставить его работать. Я не знаю, где изменить класс содержимого или класс .foodiv
.
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
div {
display: flex;
}
.foodiv {
background-color: lightcoral;
display: flex;
flex-direction: column;
justify-content: center;
flex-wrap: wrap;
flex-grow: 4;
flex-basis: auto;
align-content: stretch;
align-self: auto;
width: 100%;
height: 85%;
margin: 10px;
}
.content {
padding: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="food.css">
<title>Document</title>
</head>
<body>
<div class="foodiv">
<center>
<table id="t" style="color:white">
<tr>
<td class="content"><a style="text-decoration:none;" href="pizza.html"><button>Pizza</button></a></td>
<td class="content"><a style="text-decoration:none;" href="pasta.html"><button>Pasta</button></a></td>
<td class="content"><a style="text-decoration:none;" href="burger.html"><button>Burger</button></a></td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="noodles.html"><button>Noodles</button></a></td>
<td class="content"><a style="text-decoration:none;" href="hs.html"><button>Chinese Hot and Sour
Soup</button></a></td>
<td class="content"><a style="text-decoration:none;" href="cgs.html"><button>Carrot Ginger Soup</button></a>
</td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="breadroll.html"><button>Bread Roll</button></a>
</td>
<td class="content"><a style="text-decoration:none;" href="ps.html"><button>Paneer Sandwich</button></a>
</td>
<td class="content"><a style="text-decoration:none;" href="vegetablemaggie.html"><button>Vegetable
Maggie</button></a></td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="frenchtoast.html"><button>French
Toast</button></a></td>
<td class="content"><a style="text-decoration:none;" href="tacos.html"><button>Tacos</button></a></td>
<td class="content"><a style="text-decoration:none;" href="momos.html"><button>Momos</button></a></td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="pt.html"><button>Paneer Tikka</button></a></td>
<td class="content"><a style="text-decoration:none;" href="ccb.html"><button>Crispy Chilly
Babycorn</button></a></td>
<td class="content"><a style="text-decoration:none;" href="ac.html"><button>American Chopsuey</button></a>
</td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="q.html"><button>Quesadilla</button></a></td>
<td class="content"><a style="text-decoration:none;" href="chococake.html"><button>Chocolate
Cake</button></a></td>
<td class="content"><a style="text-decoration:none;" href="lbp.html"><button>Lemon Bar Peeps</button></a>
</td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="sbpie.html"><button>Strawberry Pie</button></a>
</td>
<td class="content"><a style="text-decoration:none;" href="tiramisu.html"><button>Tiramisu</button></a></td>
<td class="content"><a style="text-decoration:none;" href="pc.html"><button>Panna Cotta</button></a></td>
</tr>
<tr>
<td class="content"><a style="text-decoration:none;" href="bmc.html"><button>Blueberry Muffin
Cake</button></a></td>
<td class="content"><a style="text-decoration:none;" href="cheesecake.html"><button>Cheesecake</button></a>
</td>
<td class="content"><a style="text-decoration:none;" href="cm.html"><button>Chocolate Milkshake</button></a>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>