What is the best way to divide the height of one div evenly among three other divs?

I have three child divs inside a parent div and I'm looking to distribute the height of the parent div evenly among the three children.

Here is the HTML code:


    <div class="frameright">
        <div class="divright">
            <table class="right" id="andamento">
                <caption style="text-align:left">Em Andamento()</caption>
                <thead>
                    <tr>
                        <th>Chamado</th>
                        <th>Atividade</th>
                        <th>Titulo</th>
                        <th>Inicio</th>
                        <th>Hora</th>
                        <th>tempo</th>
                    </tr>
                </thead>    
                <tbody>
                    <tr>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="divright">
            <table class="right" id="aberto">
                <caption style="text-align:left">Aberto()</caption>
                <thead>
                    <tr>
                        <th>Chamado</th>
                        <th>Atividade</th>
                        <th>Titulo</th>
                        <th>Abertura</th>
                        <th>Previsão</th>
                        <th>Dias</th>
                    </tr>
                </thead>    
                <tbody>
                    <tr>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>   
                </tbody>
            </table>
        </div>
        <div class="divright">
            <table class="right" id="encerrado">
                <caption style="text-align:left">Encerrado()</caption>
                <thead>
                    <tr>
                        <th>Chamado</th>
                        <th>Atividade</th>
                        <th>Titulo</th>
                        <th>Inicio</th>
                        <th>Hora</th>
                        <th>Conclusão</th>
                        <th>Hora</th>
                        <th>Tempo</th>
                    </tr>
                </thead>    
                <tbody>
                    <tr>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>   
                </tbody>
            </table>
        </div>
    </div>

And here is the CSS:


    html{margin:1px;}
    body{font-size:70%;margin: 0px;}
    p{font-size:medium;}
    html,body{font-family:Verdana, Geneva, Tahoma, sans-serif;overflow:hidden;height:98%;}

    table{border-spacing: 1px;}
    table thead tr th{width:2%;background: #2F75B5;font-weight: normal;padding: 2px 3px;color:#FFFFD4;}
    table tbody tr td{z-index:0;background-color:#DDEBF7;min-width:1%;}

    table.right{margin: 5px 0 0 0;max-height: 33%;}
    table.right tbody td:hover {background-color:#79B7E7}
    table.right tbody tr:hover td{background-color: #79B7E7}

    .blue{background-color: #79B7E7}
    .red{background:#F08080;font-weight:normal;}
    .green{background-color:#60CA8F;font-weight:normal;}

    .number{text-align:right;} 

I am seeking assistance on how to equally distribute the height between these three div elements. Can anyone provide guidance?

Answer №1

To start, make sure your parent div has a specified height like this:

.frameright{
      height: some_value;
  }

Next, distribute that height evenly among each of your child divs by using a percentage, such as 33.3% in this scenario.

.divright{
    height:33.3%;
 }

Answer №2

If you are looking to make the main div match the height of the browser window, you can achieve this by including the following CSS code:

.framecontainer{ height: 100%; }
.subcontainer{ height:33.3%; }

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

The SVG image exceeds the boundaries of the parent column div in bootstrap

I am struggling to make a SVG fit inside a column in a bootstrap div with col-lg-4. I tried using img-fluid, but it did not work as expected. The SVG should automatically adjust its size to fit the parent div. However, that is not happening. .star-ratin ...

Continuous refreshing of window during Ajax and PHP form submission

Appreciation to those who took the time to read this post! I have a contact form on my website and I am facing an issue where the window keeps refreshing after submission, despite using Ajax with a POST method. Below is the HTML code: <form class="fo ...

What is the best way to create a stylish outward curve effect for an active sidebar item using just CSS

After spending a week learning frontend designs, I attempted to replicate a design from Dribble. However, I've been struggling with recreating the active style on the sidebar due to the outward curve. If anyone could provide guidance on achieving thi ...

What are the steps to implement email validation, Saudi mobile number validation, and national ID validation in cshtml?

Looking to implement validations for the following fields: email, mobile number (must be 10 numbers and start with 05), and National ID (must be 10 numbers and start with 1 or 2) <input class="form-control" type="text" id="txt ...

Utilizing the `theme` property in makeStyles with Material-UI

I am currently working on passing down an muiTheme to a component through the use of ThemeProvider, and I also want to apply it to the children components. Furthermore, I aim to utilize the theme's properties in both components by creating a classes o ...

Type content in HTML5

Can you help me with a simple question? I am currently working on building my portfolio using html https://i.stack.imgur.com/rxYRS.png I want to be able to click on an image and add the description of my choice. Right now, it is showing something else: ...

Scrollable navigation bar at the bottom styled with Bootstrap

I've been trying to find an answer to this question online but haven't had any luck. I designed a responsive bottom navbar with Bootstrap, but I'm encountering an issue when listing multiple items using the <li> tag - it creates a new ...

When using Next.js, I have found that the global.css file only applies styles successfully when the code is pasted directly into the page.tsx file. However, when attempting to

I recently started exploring nextjs and came across this video "https://www.youtube.com/watch?v=KzqNLDMSdMc&ab_channel=TheBraveCoders" This is when I realized that the CSS styles were not being applied to HeaderTop (the first component cre ...

Memory Match: Picture Edition

In this memory game, letters are used. I had considered changing it to a picture-based game, but I faced difficulty in generating images and incorporating them into the array. <script> var memory_array = ['A', 'A', 'B&ap ...

Dynamically created HTML elements have no events attached to them in Angular and jQuery

Utilizing jQuery, I am dynamically generating new elements within an Angular Form that has been constructed using a Template Driven Forms approach. Despite successfully creating the dynamic elements, they do not seem to be assigned events/callbacks due to ...

Removing an item from a table row cannot be completed due to the inability to retrieve the list_body ID necessary for deletion

I have been working on enhancing the delete button function in my table. The id linked to the list_body must be incorporated into the delete function code. I utilized some jquery methods to render the list onto the webpage. //retrieve user list information ...

What is the best way to adjust the width of a column to perfectly fit its contents when using IE9 compatibility mode?

Within my HTML code, I've included the table displayed below. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <style type="text/css"> table, td, tr, th{ border:1px; } .onepx{ ...

Tips for utilizing jQuery to display images similar to videos

Are there any plugins available that can create a video-like effect on images by incorporating scroll, pan, tilt, zoom (in/out) transitions for a few seconds before fading to the next image? I've searched but haven't found anything quite like thi ...

The SVG element's width is set to 100%, but it does not expand

Here is the SVG code snippet I am currently working with: <div className="behaviorPatternsItem" key={item.id}> <div className="behaviorPatternsItemStyled"> <svg height="25" width="100%" preserveAspectRatio="non ...

Uniform dimensions for HTML tables

When creating an HTML document with consecutive tables that need to be formatted the same way, it can be challenging. Browsers will often render columns of one table wider than another simply due to content width. The typical solution is to hard-code colu ...

Exploring the implementation of if/else statements in Sass/HTML

I need assistance with customizing the appearance of a save button on my form. The button is currently disabled and appears in blue color, but I would like it to change to a different color until all fields within the form are completed. Even though it c ...

Tips for connecting elements at the same index

.buttons, .weChangeColor { width: 50%; height: 100%; float: left; } .weChangeColor p { background: red; border: 1px solid; } .toggleColor { background: green; } <div class="buttons"> <p><a href="#">FirstLink</a></ ...

Assist in HTML to exhibit the display name property devoid of a label

Here is the code snippet I am working with: [Display(Name = "Empresa")] public string Company{ get; set; } In my ASPX file, I have: <th><%: Html.LabelFor(model => model.Company)%></th> This code generates the following output: < ...

Unusual marker appearing on every page utilizing ionic v1 and angularjs

For some unknown reason, a dot appears at the upper left side of each page in my webapp: https://i.stack.imgur.com/nN61t.png It seems to be an issue with the HTML code. When I run the snippet below, the dot is visible: <ion-view view-title="Send fe ...

How come the changes in my react component's CSS are not updating in real-time?

After integrating redux into my create-react-app project, I've been struggling to implement a navigator that highlights the active "page link." To achieve this functionality, I am using a combination of react hooks (to maintain the current page state) ...