Sections overlap, extending the content beyond their designated boundaries

I am facing an issue where the header in the first section remains fixed as an attachment, but when I resize the browser window, the background only covers a small portion of the section. The rest of the content either goes under another section or completely out of the background. As you can see, opening this page in full screen resolves the problem and the sections look correct. However, reducing the window causes the sections to fall apart and overlap each other. Could this be due to a lack of clearfixes or is it a positioning issue with each section?

https://codepen.io/tubaris/pen/YQQewB/

<html lang="pl">
<head>
    <meta charset="UTF-8">
    <meta name="description" content="Omnifood">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Omnifood</title>
    <link rel="stylesheet" type="text/css" href="vendors/css/style.css">
    <link rel="stylesheet" type="text/css" href="vendors/css/ionicons.min.css">
    <link href="https://fonts.googleapis.com/css?family=Lato:100,300,400&amp;subset=latin-ext" rel="stylesheet">
</head>   
<body>
    <header>
        <nav>
            <div class="row">
                <img src="https://image.ibb.co/bY2jyQ/logo_white.png" alt="Omnifood logo" class="logo">
                <ul class="main-nav">
                    <li><a href="#">Food delivery</a></li>
                    <li><a href="#">How it works</a></li>
                    <li><a href="#">Our cities</a></li>
                    <li><a href="#">Sign up</a></li>
                </ul>
            </div>
        </nav>       
        <div class="header-text-box">
            <h1>Goodbye junk food.<br>Hello super healthy meals.</h1>
            <a href="#" class="btn btn-coloured">Iā€™m hungry</a>
            <a href="#" class="btn btn-bordered">Show me more</a>
        </div>
    </header>
    <section class="section-features">
        <div class="row">
            <h2>Get food fast &ndash; not fast food.</h2>
            <p class="text-about">Hello, we're Omnifood, your new premium food delivery service. We know you're always busy. No time for cooking. So let us take care of that, we're really good at it, we promise!</p>
        </div>
        <div class="row">
            <div class="feature-col">
                <i class="ion-clock icon-big"></i>
                <h3>Up to 365 days/year</h3>
                <p>Never cook again! We really mean that. Our subscription plans include up to 365 days/year coverage. You can also choose to order more flexibly if that's your style.</p>
            </div>
            <div class="feature-col">
                <i class="ion-jet icon-big"></i>
                <h3>Ready in 20 minutes</h3>
                <p>You're only twenty minutes away from your delicious and super healthy meals delivered right to your home. We work with the best chefs in each town to ensure that you're 100% happy.</p>
            </div>
            <div class="feature-col">
                <i class="ion-ios-nutrition icon-big"></i>
                <h3>100% Organic</h3>
                <p>All our vegetables are fresh, organic and local. Animals are raised without added hormones or antibiotics. Good for your health, the environment, and it also tastes better!</p>
            </div>
            <div class="feature-col">
                <i class="ion-card icon-big"></i>
                <h3>Order anything</h3>
                <p>We don't limit your creativity, which means you can order whatever you feel like. You can also choose from our menu containing over 100 delicious meals. It's up to you!</p>
            </div>
        </div>
    </section>
    <section class="section-meals">
        <div class="row">
            <h2>Omnifood meals showcase</h2>
            <p class="text-about">Selected Omnifood meals offered by our company</p>
        </div>
        <ul class="meals-showcase">
            <li>
                <figure class="meal-photo">
                <img src="https://preview.ibb.co/eTtwCk/1.jpg" alt="egg with vegetables">
                </figure>
            </li>
            <li>
                <figure class="meal-photo">
                <img src="https://image.ibb.co/iFpgdQ/2.jpg" alt="california rolls sushi">
                </figure>    
            </li>
            <li>
                <figure class="meal-photo">
                <img src="https://preview.ibb.co/igwGCk/3.jpg" alt="asparagus with carrots and meat">
                </figure>   
            </li>
            <li>
                <figure class="meal-photo">
                <img src="https://preview.ibb.co/h74sk5/4.jpg" alt="carrot soup with nuts">
                </figure>
            </li>
        </ul>
        <ul class="meals-showcase">
            <li>
                <figure class="meal-photo">
                <img src="https://preview.ibb.co/j4MuyQ/5.jpg" alt="steak with green beans">
                </figure>
            </li>
            <li>
                <figure class="meal-photo">
                <img src="https://image.ibb.co/m8twCk/6.jpg" alt="roll with egg, rucola and radish">
                </figure>
            </li>
            <li>
                <figure class="meal-photo">
                <img src="https://preview.ibb.co/bBjEyQ/7.jpg" alt="healthy burger">
                </figure>
            </li>
            <li>
                <figure class="meal-photo">
                <img src="https://preview.ibb.co/fNWisk/8.jpg" alt="oatmeal with strawberries and cherries">
                </figure>
            </li>
        </ul>
    </section>
    <section class="section-steps">
        <div class="row">
            <h2>How it works &ndash; Simple as 1, 2, 3</h2>
        </div>
        <div class="row">
            <div class="steps-col1">
                <img src="https://image.ibb.co/hHoeXk/app_i_Phone.png" alt="Omnifood app on iPhone" class="app-screen">
            </div>
            <div class="steps-col2">
                <div class="works-step">
                    <div>1</div>
                    <p>Choose the subscription plan that best fits your needs and sign up today.</p>
                </div>
                <div class="works-step">
                    <div>2</div>
                    <p>Order your delicious meal using our mobile app or website. Or you can even call us!</p>
                </div>
                <div class="works-step">
                    <div>3</div>
                    <p>Enjoy your meal after less than 20 minutes. See you the next time!</p>
                </div>
                <a href="#" class="btn-app"><img src="https://image.ibb.co/gyPxJQ/download_app.png" alt="app store button"></a>
                <a href="#" class="btn-app"><img src="https://image.ibb.co/jZWYsk/download_app_android.png" alt="play store button"></a>
            </div>
        </div>
    </section>
</body>

`

Answer ā„–1

It seems like you're curious about why the .features-col divs on your website are being clipped.

The issue stems from the fact that the .features-col divs are removed from the normal document flow and as a result, do not expand the .section-features div. This behavior is caused by the use of the float: left property. Removing this property will allow the columns to properly expand within their parent container.

An alternative approach to aligning the columns to the left side of the page would be to set the .row class width to 100% of the window width and then apply text-align: left.

Answer ā„–2

To achieve a left float for the .meal-photo class, simply include float:left within your CSS styling for that specific class.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Placing an image at the bottom within a DIV container in HTML

My goal is to neatly align a group of images at the bottom of a fixed-height div. The images all have the same height and width, making the alignment easier. Here is the current structure of my code: <div id="randomContainer"> <div id="image ...

Display the accurate duration based on the dates selected in an HTML form automatically

If someone has office hours on Monday, Wednesday, and Friday from 7:00 am to 7:00 pm, and on Tuesday and Thursday from 10:00 am to 9:00 pm, the dropdown menu should display only the timings of 7:00 AM to 7:00 PM if the selected date is a Monday, Wednesda ...

Determine whether the server request originated from an Ionic mobile application

Currently, we are in the final stages of completing an Ionic project with a PHP backend. To enhance the security of our backend and protect it from external influences, we aim to restrict access to the backend only from within the Ionic project (native app ...

The vertical tab layout in HTML and CSS is experiencing an issue where the active tab is not being shown above the

Currently, I am developing a web page featuring vertical tabs where each tab corresponds to an image and some content. However, the problem lies in the fact that the active tab is not displaying above the image as expected. In my attempt to resolve this i ...

A compilation of approved classes for the quill toolbar

The instructions provided in the documentation for the quill module indicate that you can manually create a toolbar using HTML, and then pass the corresponding DOM element or selector to Quill. This will result in the ql-toolbar class being added to the to ...

Encountering a Node Js post handling error with the message "Cannot GET /url

This is my ejs file titled Post_handling.ejs: <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>POST-Handling Page</title> </head> <body& ...

What could be causing the HTML5 canvas not to show up on the screen?

<!doctype html> <html> <head> <title>Canvas test</title> </head> <body> <script type="text/javascript"> c = getElementById('canvas'); ctx = c.getContext("2d")' ctx.fillRect(10,10,10,10); </s ...

How can the style of a div's :after pseudo-element be modified when hovering over its :before pseudo-element?

Here is some CSS code: .myDiv:before{ content:''; width:15px; height:15px; display:block; } .myDiv:after{ ... ... display:none; } And here is the corresponding HTML code: <div class='myDiv'></div> ...

Is it necessary to have uniform spacing between links in a responsive navigation menu?

I am attempting to create a horizontal menu navigation system. I have multiple links in the navigation, and my goal is to evenly space them horizontally. Is there a way to achieve uniform spacing between links in a horizontal menu? HTML: <div id= ...

Responsive CSS design that adjusts to fit the content

Struggling to make the wrapper expand with its content... This is the structure: * { padding: 0; margin: 0; } body { background-color: #ccc; background-repeat:repeat; font: Tahoma, Geneva, sans-serif; color: #FFF; } .wrapper { width: 95%; margin: 0 au ...

Show user information from a MySQL database in a dynamically generated table using PHP

I am working on developing an absence tracking system using PHP and MySQL. Each absence is categorized by a specific leave type, such as sick or emergency. The goal is to present this information in an HTML table format where the names of users are display ...

Achieve a sliding effect between two divs using CSS only

I'm trying to create a design with 2 divs that are the same size. The first one is visible by default, while the second one is hidden initially. My goal is to achieve an effect where when you hover over the first div, the second one slides upward and ...

Retrieving data from a database in PHP and assigning it as the value for an HTML select tag

Seeking assistance on a project to develop a stock management system for an herb factory using PHP with a MySQL database. Currently working on a page that allows the user to edit the value of a bench containing herbs. The bench details have been stored in ...

Notification window when the page is being loaded

My goal is to have a module or alert box display when my website is opened, and then disappear after 5 minutes. To see an example of what I'm looking for, take a look at this website: On that website, there is a facebook.com box that automatically d ...

What is the best way to adjust the vertical margin in a vis.js timeline?

The vis.js timeline sets a margin of 5px in each row using inline styles that are controlled programmatically by the library. The height, top position, and transform of each item within the row are specified by the library as well. Attempting to manually ...

How can I generate a checkbox in a database with a field that allows for enabling and disabling?

I am looking to design a table that includes questions, checkboxes, and text boxes. All the questions are stored in a database and called through an array. In addition, I want to create disabled textboxes that become enabled when their corresponding checkb ...

Ways to format table using flex-wrap sans the use of flexbox

My HTML and CSS structure is as follows: .item { background: white; padding: 5px; display: inline-block; text-align: center; } .item > div { background: yellow; width: 60px; height: 60px; border-radius: 50%; display: table-cell; ...

Unable to apply border-radius to a specific HTML table

I am facing an issue where the border-radius is not being displayed on a specific HTML table. I am having difficulty in applying rounded corners to the entire table so that the table edges have a 30px curve. Here is an example of what I am looking for: I ...

Prevent the tab key from exiting the input field and instead direct it to a designated element on the webpage

I have customized a select menu for user interaction, but I am facing issues with normal keyboard behaviors not working as expected. Specifically, I want to enable tab functionality to navigate to my styled select menu just like when clicking tab to cycle ...

Preventing box shadows from blending together

I'm struggling with a design issue on my site where I have four divs in the center, each represented by a box with a box-shadow. Unfortunately, the colors of the shadows are getting mixed up and creating an unwanted effect. Below is the CSS code used ...