Addressing the space discrepancy between the div element and the footer segment

I'm facing some issues with the layout of my DIVs.

There seems to be a large gap between my divs and the footer in this example. How can I make the divs line up right underneath the footer?

Another problem is that box 2,3,4 don't seem to have aligned bottoms. How can I ensure they all have the same height? Currently, I'm winging it with height percentages.

Appreciate any help on these matters.

Here's the HTML code snippet:

<div id="wrapper">
    <div class="logo">logo</div>

    <div id="header">
        <a href="#">link 1</a>
        &nbsp;|&nbsp;
        <a href="#">link 2</a>
        &nbsp;|&nbsp;
        <a href="#">link 3</a>
        &nbsp;|&nbsp;
        <a href="#">link 4</a>
    </div>

    <div style="clear: both;"></div>

    <div class="column" id="first-column">
        <div class="window" id="window-1">1</div>
        <div class="window" id="window-2">2</div>
    </div>

    <div class="column" id="second-column">
        <div class="window" id="window-3">3</div>
    </div>


    <div class="column" id="third-column">
        <div class="window" id="window-4">4</div>
    </div>
    <div style="clear: both;"></div>
    <div class="footer">footer</div>
</div>

CSS styles being used:

body, html{
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    height: 100%;
}

#wrapper {
    margin: 0 auto;
    max-width: 1212px;
    min-height: 540px;
    min-width: 784px;
    position: relative;
    height: 100%;
}

#header{
    text-align:right;
    padding:5px;
    font-size:10px;
    padding-right: 30px;
}

#first-column{
    width: 20%;
    padding-left: 5px;
    height: 100%;
}

#second-column{
    width: 50%;
    height: 100%;
}

#third-column{
    width: 25%;
}

.window{
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    border:1px solid #CECECE;
    width:100%;
}

#window-1{
    height:43.5%;
}

#window-2{
    margin-top:10px;
    height:43.5%;
}

#window-3{
    height:87%;
    padding-bottom: 10px;
}

#window-4{
    height:87%;
    padding-bottom: 10px;
}

.column{
    float:left;
    margin: 5px;
    height: 100%;
}

.logo {
    font-family: arial;
    font-size: 12px;
    float: left;
    padding-left: 10px;
}

.footer {
    margin-top: 10px;
    padding-left: 10px;
}

Answer №1

When you encounter issues, it's best to eliminate the <strong>height:100%</strong> code first.

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 design <p> elements inside a bordered container?

I am currently working on a webpage that features text enclosed in bordered boxes with styled formatting. The primary issue I am encountering is that when I try to add another paragraph within the styled <p> tag containing the border styling, the su ...

Can you save data entered by a user into a text file using JavaScript or a similar technology in HTML, without the need to send it to a server?

Is there a way to create a site where user data is inputted into an input box or form, and then that information is stored in a .txt file on the user's C drive without uploading it to a server first? I've been experimenting with various forms an ...

Learn the process of utilizing Javascript to substitute additional texts with (...) in your content

I am facing a challenge with a text field that allows users to input text. I want to use JavaScript to retrieve the text from the textbox and display it in a paragraph. However, my issue is that I have set a character limit of 50. If a user exceeds this li ...

What is the best way to center align and add an icon to the header in Ionic?

How can I center align an "ion-ios-arrow-up" icon in the header of my Ionic app, similar to the concept shown below? This is my HTML template: <ion-view cache-view="false" view-title="Historical HPP"> <ion-nav-bar class="nav-title-slide-ios7 ...

Switch up div content - advertisements at the top or bottom

An issue has arisen where the ads on a website are currently being displayed at the bottom of the source code, but they should actually be visible at the top. Here is the ad placeholder code: <div id="300_250_placeholder"></div> And here is ...

Swap the image when hovering over it

Is it possible to modify this specific code so that a hover effect is triggered on mouseover? I attempted to look into similar questions and answers, but I found them difficult to understand. Here is the HTML snippet: <a href="RR.html"><img src ...

What is the best way to align my header buttons in the center and move items to the far right of my toolbar?

My header currently displays as follows: https://i.sstatic.net/h8zDQ.png I am aiming to center the [LEARN MORE, ABOUT, RESOURCES, CONTACT] buttons in the middle of the navbar and align the profile icon and switch button to the far right of the page! I en ...

Are you making the switch to Bootstrap 4 from Bootstrap 3?

Currently, I am utilizing bootstrap 3 in my project. Upon discovering that Bootstrap 4 is a significant overhaul of the entire Bootstrap project, I am contemplating whether it is essential to transition from version 3 to 4. Is there a compelling reason t ...

Feeling anxious about the abundance of fields within the table

Currently in the process of planning my upcoming project, a text-based MMORPG game. I'm tackling the design of certain aspects of the database and have encountered a new challenge. One feature of the game involves allowing players to purchase cars and ...

Embedding a Material-UI Icon into an Input Field within a React Application

Hello, I am currently using a datepicker provided by Material-UI Datepickers. When utilizing the Inline datepicker option, I would like to include a calendar icon within the input field. Below is the code snippet representing the input element. How can I ...

align the button to the same location as the other element

I'm currently working with an HTML layout that features a two-column structure. The code snippet below highlights this setup: <div class="card-body"> <div class="row"> <div class="col-md-10"> ...

What is the best way to assign unique values to separate sets of radio buttons?

In my application, I have a list of animals with two sets of radio buttons for each animal- one for extinct (y or n) and the other for habitat (land or water). If the user selects "y" for extinct, the habitat radio buttons are disabled. If they select "n" ...

What is the best way to create a Material toolbar that changes from transparent to opaque when scrolling?

I'm in the process of familiarizing myself with Angular. I have incorporated Angular Material and I am trying to achieve a sticky and opaque material toolbar that becomes transparent with visible text when scrolling at the top of the page. Most soluti ...

Utilizing Material UI to access CSS classes in React

Seeking guidance on incorporating CSS within another CSS in React using Material-UI. Although I am familiar with using @extends and @mixin for applying CSS rules, I encountered a challenge when working with React and Material-UI. How can I address this iss ...

What is the process for displaying a PHP array in HTML5 audio and video players?

I am currently working with two PHP arrays. The first array, array "a," contains strings that represent paths for MP3 files on the server. The second array, array "b," contains strings representing paths for MP4 files. For example: $test = 'a.mp3&ap ...

Body component of Bootstrap4 is not displaying

.navbar-btn { color: white; background-color: rgba(255, 255, 255, 0); } .navbar-btn:hover { color: skyblue; background-color: rgba(255, 255, 255, 0); } .dropdown-item { color: white; } .dropdown-item:hover { color: skyblue; back ...

Is there a way to align certain buttons to the left and others to the right within a DIV?

One of the strategies I experimented with was: <div class="block-footer"> <div> <button class="align-left">xx</button> <button class="align-right">yy</button> </div> </div> I'm ...

Change Dropdown menu orientation to vertical

Struggling to convert a CSS drop down menu into a vertical menu. I've tried multiple solutions but can't seem to achieve the desired result. Here is my CSS and HTML code, can anyone point out what I might be missing? #sddmT { margin: 0; pa ...

Using Javascript to retrieve a variable and dynamically updating the source of an HTML iframe

I have two JavaScript variables, 'long' and 'lat', in the code below. My challenge is to append these values to the end of the iframe URL. I would appreciate assistance on modifying the code below to achieve this. The iframe code bel ...

Activating/Deactivating a button with just a press

In my SQL data display, each row has an "Add To Zip" button that is initially enabled. I want to disable the button in the current row when it's clicked and later re-enable them using a different PHP file. What's the best way to achieve this with ...