What seems to be the issue with my 2-column design layout?

When I try to arrange my webpage with a 2 column layout, adding an image messes up the footer. Without the image, the footer looks correct.

<!DOCTYPE html>
<html lang="en">

<head>

  <title>SuperRestraunt</title>
  <meta charset="utf-8">
  <link href="Style.css" rel="stylesheet">

</head>

<body>
  <a name="top"></a>
  <nav class="nav">
    <div class="menu">
      <a href="index.html">Home</a>
    </div>
    <div class="menu">
      <a href="shopnow.html">Full Menu</a>
    </div>
    <br/>
    <br/>
  </nav>
  <main class="wrapper">

    <div class="banner">
      <h1><span class="name">SuperRestraunt</span></h1>
      <h2>Serving the best food in Macon since 2015.</h2>
      <h2>Please take a look at our available coupons in the list below.</h2>
      <div class="bulletPoints">

        <ul>
          <li>Buy one burger, get one FREE</li>
          <li>30% off one dessert item</li>
        </ul>
      </div>
      <br/>

    </div>
    <div class="twocolumns">


      <p> Are you looking for the best southern cooking in all of middle Georgia? If so, you have looked in the right place!</p>

      <p> Our chefs have over 30 years in combined experience</p>







    </div>

    <h2><em>Contact us for a reservations</em></h2>
    <p>Please call at least 2 days ahead for all reservations that include 10 or more people.</p>


  </main>

  <footer class="footer">
    <div class="box">
      <p>SuperRestraunt</p>
      <p>(478) 302-1981</p>
      <p><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="09646867686e6c7b497a7c7c6976794d78367a767477">[email protected]</a></p>
      <br/>
    </div>
    <div class="box">
      <p>Check out are Social Media for more coupons and pictures!</p>
      <p>Facebook:</p>
      <p>Instagram:</p>
      <p>Twitter:</p>
    </div>
    <div class="box">
      <p>Locations:</p>
      <br/>
      <p>543 Cherry St suite b, Macon, GA 31201</p>
    </div>
  </footer>

  <div class="copyright">
    <h2>@copyright: Landon Byrd</h2>
    <p>Fall 2021, All Rights Reserved</p>
  </div>

  <p>
    <a href="http://jigsaw.w3.org/css-validator/check/referer">
      <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" />
    </a>
  </p>

  <a href="#top">Back to top of page</a>
</body>

</html>

CSS

/*

Landon Byrd
Fall 2021

    Light Blue  #06aed5
    Darker Blue #086788
    Cream White #f2f4f3
    Yellow      #f0c808
    Rich Red    #dd1c1a 
*/
/* Global Settings */
h1 {text-align: center}
h2 {text-align: center; color: #086788}
.wrapper{width:85%; margin:0 auto; max-width: 960px; }

/* Nav Section */
.nav{width: 85%; margin:0 auto; background-color: #06aed5; text-align: center;}
.menu{float:left; width:25%;}

/* Main Section */
.banner{justify-content: center;background-color: #06aed5; border-radius: 2pt; color: #f2f4f3;}
.bulletPoints{margin-left:35%;}


.name{font-weight: bold; color: #f0c808}

.twocolumns{}
.img1 {float:left; width: 400px; height: 175px; margin:15px}
   
/* Footer Section */
*{box-sizing: border-box;}
.footer{text-align: center; background-color: #06aed5; color: #086788; }
.box{float:left; width: 33.33%;}
.footer::after{content: ""; clear:both; display:table;}

/* copyright section */
.copyright {text-align: center; background-color: #06aed5; color: #086788; }

Pictures https://i.sstatic.net/Z7Rg2.png

https://i.sstatic.net/nVltf.png

Also, how can I remove the white space between the copyright section and the footer? Thank you in advance.

Answer №1

/*

Austin Reynolds
Spring 2022

    Baby Blue   #96c1ff
    Navy Blue   #001f3f
    Cream       #eff9f0
    Amber       #ffb72b
    Crimson     #dc3545 
*/
/* Custom Styles */
h1 {text-align: center}
h2 {text-align: center; color: #001f3f}
.wrapper{width:85%; margin:0 auto; max-width: 960px; }

/* Navigation Section */
.nav{width: 85%; margin:0 auto; background-color: #96c1ff; text-align: center;}
.menu{float:left; width:25%;}

/* Main Content */
.banner{justify-content: center;background-color: #96c1ff; border-radius: 2pt; color: #eff9f0;}
.bulletPoints{margin-left:35%;}


.name{font-weight: bold; color: #ffb72b}

.twocolumns{display:flex;}
.img1 { width: 400px; height: 175px; margin:15px}
   
/* Footer Area */
*{box-sizing: border-box;}
.footer{
text-align: center;
background-color: #96c1ff;
color: #001f3f;
display: flex;
justify-content: space-between; }
.box{ width: 33.33%;}
.footer::after{}

/* Copyright Info */
.copyright {text-align: center; background-color: #96c1ff; color: #001f3f; margin-top:-19px; }
<html lang="en">
<head>

    <title>SuperCafe</title>
    <meta charset="utf-8">
    <link href="Style.css" rel="stylesheet">
    
</head>
<body>
<a name="top"></a>
    <nav class="nav">
        <div class="menu">
            <a href="index.html">Home</a>
        </div>
        <div class="menu">
            <a href="menu.html">Browse Menu</a>
        </div>
        <br/>
        <br/>
    </nav>  
    <main class="wrapper">
    
        <div class="banner">
            <h1><span class="name">SuperCafe</span></h1>
            <h2>Serving the finest coffee in town since 2018.</h2>
            <h2>Check out our latest offers and discounts below.</h2>
            <div class="bulletPoints">
            
                <ul>
                    <li>Buy one latte, get one FREE</li>
                    <li>20% off any pastry of your choice</li>
                </ul>
            </div>
            <br/>
            
        </div>
        <div class="twocolumns">
            <img class="img1" src="images/coffee.jpg" alt="coffee">     

            <p> Looking for top-notch espresso in the heart of downtown? Look no further!</p>
            
            <p> Our baristas have a combined experience of 30 years</p>
            

            
        



        </div>
        
        <h2><em>Call us to reserve a spot</em></h2>
        <p>Please make reservations at least 48 hours in advance for groups of 10 or more.</p>


    </main>
    
    <footer class="footer">
        <div class="box">
            <p>SuperCafe</p>
            <p>(555) 123-4567</p>
            <p><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="205d51505753504450565e57515556555e4451545253">[email protected]</a></p>
            <br/>
        </div>
        <div class="box">
            <p>Follow us on Social Media for more promotions and photos!</p>
            <p>Facebook:</p>
            <p>Instagram:</p>
            <p>Twitter:</p>
        </div>
        <div class="box">
            <p>Locations:</p>
            <br/>
            <p>123 Elm St, Anytown, USA 54321</p>
        </div>
       
    </footer>
    
     <div class="copyright">
          <h2>@copyright: Austin Reynolds</h2>
          <p>Spring 2022, All Rights Reserved</p>
      </div>
    
<p>
    <a href="http://jigsaw.w3.org/css-validator/check/referer">
        <img style="border:0;width:88px;height:31px"
            src="http://jigsaw.w3.org/css-validator/images/vcss"
            alt="Valid CSS!" />
    </a>
</p>

<a href="#top">Back to top of page</a>              
</body>
</html>

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

How to Create a Speech Bubble in SVG Using SnapSVG

In the process of developing a chat program, I have animated figures moving across the screen engaging in conversations. One crucial aspect I am yet to implement is creating scalable speech bubbles for when users interact. Being relatively new to SVG and ...

How do I convert the object value/data to lowercase in JavaScript using underscore for an HTML5 document?

I am working with an array of objects (arr) where each object consists of 3 properties (Department, Categories, ProductTypes). The values for these properties are a mix of upper and lower case. To perform a comparison between arr and a search filter (alrea ...

CSS - Is there a way to alter the arrangement of DIVs depending on the size of the screen?

My inquiry pertains to a CSS layout. I currently have 3 divs positioned in a horizontal line next to each other, as depicted below... div1 div2 div3 I am aiming for the divs to reorganize themselves as the screen size decreases. In one scenario, they sho ...

Email header image alignment issue in Thunderbird

I recently created an HTML email using a template and it looks great on most platforms, but not in Thunderbird. The header image is not aligned properly above the content as shown in the screenshot. Does anyone know how to troubleshoot this issue or have a ...

Can CSS Grid layout be used to generate a grid consisting of squares?

I'm trying to set up a grid with equal square dimensions, but I'm having trouble with it. I've explored CSS Grid as a possibility since I thought it allowed for the creation of squares of equal height and width within a grid layout. However, ...

Change the marquee scrolling back to its original starting point

I am trying to implement a continuous image scroll (marquee) in HTML. My goal is to have the marquee stop scrolling when the mouse hovers over it, with the images returning to their initial position. Once the mouse moves away, I want the marquee to resume ...

Add a hyperlink to a div element without directly editing the HTML code

Is it possible to add a link to the div using JavaScript instead of changing the HTML and inserting an <a>-tag? <div class="some-class">Some content</div> ...

Mouse position-based scrolling that preserves click events in the forefront while scrolling

Within a larger div, I have a very wide inner div that scrolls left and right based on the position of the mouse. I found the code for this from an answer at There are two transparent divs above everything else, which capture the mouse position to determ ...

Tips for automatically incorporating animation upon page initialization

I'm looking to add an automatic image effect when the page is loaded. I currently have this code in my js file: $(window).ready(function(){ $(pin).click(function(){ $("#pin01").show().animate({left: '650px'}); }) }); Here is the HTML wit ...

The scrollbar remains unresponsive and fixed until the screen size is adjusted

Need some assistance with a website project for a client. The scrollbars on each page are not loading or changing height until the window is resized. I have a jQuery scrollbar in place, but disabling it does not solve the issue as the normal scrollbar beha ...

Intermittent Z-index conflicts in need of a solution - seeking guidance

Is there a way to make the h1 heading and img image elements appear on top of the opaque div they are enclosed in? I want them to look unaffected by the transparency of their parent div. Here is a Fiddle demonstrating my issue: <div id="main"> ...

Executing Javascript to populate a div element with content based on its CSS class

Is there a way to isolate my View (HTML & CSS files) within a controller like JavascriptCode/AJAX, so that upon page load, only the controller binds the data to a specific element such as a DIV based on its class? Do you think this is achievable? If so, ...

Discover the magic of Bootstrap 3.0 Popovers and Tooltips

I'm struggling with implementing the popover and tooltip features in Bootstrap. While I have successfully implemented drop downs and modals, the tooltips are not styled or positioned correctly as shown in the Bootstrap examples, and the popover featur ...

jquery expanding the width of the final element

Is there a way to increase the width of the last 'th' in a string? I want it to be the current width plus 20px. Here is the code on Fiddle var header="<th id='tblHeader_1' style='width: 80px;'><span>Id</span&g ...

What steps can I take to fix the sum function?

My function calculates heart rate targets for sports, but there seems to be an issue in the switch statement. The final sum in the function is not being computed properly. For example, if someone is 20 years old with a resting heart rate of 50 beats per mi ...

Is there a way to retrieve the modal's viewport height in Angular?

Is it possible to determine the viewport height of my ng bootstrap modal within my Angular application? Here is what I currently have: I have a modal with CSS styling as shown below: .modal-xxl { width: 95% !important; max-height: 90% !important; ...

Angular's ng-model is unable to access the value of an object array

When selecting the days, users should be able to input check-in and check-out time ranges dynamically. However, there seems to be an issue with retrieving the values and data format. The ng model is unable to capture the check-in and check-out values. The ...

Are the menubar menus positioned beneath a different div element?

Currently facing an issue with an HTML Menubar where the menus are appearing below another div, and not getting displayed as expected: ...

In order to activate the button, make sure all 3 boxes are checked

Can someone provide some guidance on the script below? I'm utilizing it for a pop-up when a user attempts to add a product to the cart. Presently, the button will activate if at least one checkbox is selected (although it's not working on fiddle ...

Adjusting div to not be absolutely positioned

Trying to create a div with animated borders, but it only works when positioned absolutely in the center. For illustration, here is the HTML and CSS code: .bb, .bb::before, .bb::after { position: absolute; top: 0; bottom: 0; left: 0; right: 0; ...