I'm currently working on a website for a local restaurant, my very first project of this kind. As I draft the menu section, I'm struggling with displaying Starters and Main Courses side by side on the screen. Additionally, the layout falls apart when viewed on smaller screens.
Despite my efforts with bootstrap 4 and CSS styling using col-sm-6, float, and flex properties, I haven't been able to achieve the desired result.
<div class="menu-title">
<h1>STARTERS</h1>
<div class="menu-items">
<div class="menu-item-body">
<span class="number">1.</span>
<span class="name">Vegetable Spring Roll</span>
<span class="price">4.50 €</span>
<div class="description">
Crispy spring roll with shredded cabbage, carrot, sweetcorn and soy sauce.
</div>
</div>
</div>
<div class="menu-items">
<div class="menu-item-body">
<span class="number">2.</span>
<span class="name">Chicken Cheese Roll</span>
<span class="price">4.50 €</span>
<div class="description">
Crispy chicken cheese roll with chicken, onion, spring onion and cheese with sweet chilli sauce.
</div>
</div>
</div>
CSS
.menu-title{
flex-direction: column;
}
.menu-items {
width: 100%;
padding: 50px 30px;
flex-flow: row ;
}
.menu-item-body {
float: left;
position: absolute;
overflow-x: hidden;
padding-left: 25px;
margin: 0 1%;
width: 31%;
}
.number {
position: absolute;
left: 0;
}
.name {
background-color: #fff;
}
.name:after {
float: left;
width: 0;
white-space: nowrap;
content: ". . . . . . . . . . . . . . . . . . . . " ". . . . . . . . . . . . . . . . . . . . " ". . . . . . . . . . . . . . . . . . . . " ". . . . . . . . . . . . . . . . . . . . ";
}
.price {
padding-left: 5px;
float: right !important;
background-color: #fff;
}
.description {
font-size: 14px;
font-weight: 500;
opacity: 0.8;
margin-bottom: 10px;
}
My goal is to create a responsive design that displays 2 or 3 columns of menu items on larger screens.