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

Where did my HTML5 Canvas Text disappear to?

I am encountering a common issue with my code and could use some guidance. Despite numerous attempts, I can't seem to figure out why it isn't functioning properly. To better illustrate the problem, here is a link to the troublesome code snippet o ...

What is the most effective way to reduce the spacing between columns in Bootstrap while maintaining consistent spacing on the outer edges?

I have set up my bootstrap columns as shown below: <div class="col-6"> <a href="gallerij/stockfotos/boeken" class="catphotowrap"> <div class="catphotodiv"> <img class=&quo ...

Tips on how to stop a webpage from scrolling and instead allow only the inner content to scroll

Check out my plunker for reference. The goal I am aiming for is as follows: The webpage should stay fixed and not scroll in any direction If the content overflows its container, a scroll bar should appear strictly within that container I have a main co ...

Open $_POST in a new tab that has been edited for your convenience

<form method="post" target="_blank" action="battle.php" onsubmit="window.open('battle.php','','width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=0,left=30,top=0');" > < ...

Tips for Aligning Several Images Horizontally in an Article

Does anyone know how to center pictures in an article horizontally? I've tried various techniques without success. If it would be helpful, I can share the CSS I currently have. However, I am open to starting from scratch with the CSS as well since I ...

Having trouble showing an image with jQuery after it has been uploaded

Currently, I have a URL that shows an image upon loading. However, I want to provide the option for users to replace this image using a form input. My goal is to display the uploaded image as soon as it's selected so users can evaluate it. I'm a ...

efforts to activate a "click" with the enter key are unsuccessful

I'm attempting to enhance user experience on my site by triggering the onclick event of a button when the enter key is pressed. I've tried various methods below, but all seem to have the same issue. Here is my HTML (using Pug): input#userIntere ...

5 Ways to Incorporate Font Awesome Icons into CSS Pseudo Elements

I'm attempting to incorporate FontAwesome icons into CSS pseudo elements. When I add the icon using HTML in the traditional manner, it works fine. However, I'm trying to integrate the fonts into a bootstrap accordion so that the icon changes whe ...

Having trouble with script tag not loading content in Next.js, even though it works perfectly fine in React

Currently, I am attempting to utilize a widget that I have developed in ReactJS by utilizing script tags as shown below- React Implementation import React from "react"; import { Helmet } from "react-helmet"; const Dust = () => { ...

Adjust the image size in the jumbotron to fit perfectly without the need for scrolling

I'm in the process of creating a website with a prominent jumbotron section on the landing page. I am looking to adjust the height of the image within the jumbotron without cutting off any parts of the picture, and I do not want it to scroll to displa ...

Having trouble centering my menu bar on CSS, can anyone help?

I'm having trouble getting the buttons inside the menu bar to align properly. Does anyone have any suggestions on how to fix this? I'm not very experienced with coding, so any assistance would be greatly appreciated! .main-navigation { clear ...

Steps for adding a row as the penultimate row in a table

There aren't many solutions out there that don't rely on jQuery, but I'm looking to avoid it. The row content needs to be generated dynamically. Here is my flawed approach: function addRow() { let newRow = '<tr><td>B ...

Tips for aligning the image and text in the center of the page

Struggling to center this image on my website. I've attempted various methods like margin: 0 and absolute positions, but nothing seems to work. Being a beginner in html and css doesn't help either. My attempts to center it have been futile. The ...

Revolutionize iPad user experience with seamless HTML5 video integration

What is the most effective method for dynamically embedding HTML5 video to ensure compatibility with the iPad? (using pure Javascript) I'm having difficulty getting this approach to work: <div id="placeholder"><script type="text/javascript" ...

Is there a way to determine which option is currently highlighted in Internet Explorer before it is actually chosen?

Despite the fact that IE does not support mouse events on <option> elements, it does highlight the option under the mouse cursor when you open a dropdown list. Is there a way in JavaScript to capture this highlighted option as the user moves the mous ...

conceal a targeted section from the bottom of the iframe

I have a website embedded inside an iframe for use in a webview application. <body> <iframe id="iframe" src="http://www.medicamall.com"></iframe> </body> This is the CSS code: body { margin:0; padding:0; height:10 ...

Properly managing mouseover events on a flipped div: tips and tricks

I created a div that flips when clicked using some HTML and CSS code. It works perfectly in Firefox 39 and Chrome 43. Here is the markup: <div class="flip-wrapper flippable-wrapper" id="fliptest-01"> <div class="flip-wrapper flippable ...

What methods can be used to test scss subclasses within an Angular environment?

Exploring different background colors in various environments is a task I want to undertake. The environments include bmw, audi, and vw, with each environment having its own unique background color. Need help writing an Angular test for this? How can I mod ...

Is there a method to preserve the pressed/focused state when moving from one input box to the next?

While creating a form for a client, I encountered a requirement where the input box should change once clicked and retain that change even after it has been filled and the user moves to the next input box. Is there a way to achieve this using only HTML & C ...

Is it possible to create vertical-floating elements using CSS?

Can anyone help with a solution to my problem illustrated in the image? I am dealing with a DIV element of fixed height that contains a List. I need this List to display as columns, each list item having a fixed width. If there are too many elements in th ...