Three containers positioned within a parent container at 100% height

Within my div container (multiple_prizes in the fiddle), there are two other divs: one containing an upload button (upload_prize_img) and the other with 3 inputs (upload_prize_form). These two inner divs are positioned next to each other using bootstrap columns. You can see this layout here http://jsfiddle.net/SrL49/

(By the way, I couldn't get bootstrap to work in JSFiddle , if anyone knows how, please inform me. That's why I simulated the same effect by floating the inner divs)

In the current setup, the form div is taller than the upload div, which has a border. I want the upload div to match the height of the form so that the border extends from name to amount.

I've experimented with various combinations of setting height: 100% on all three divs, but haven't found a solution yet. If you have a solution using the bootstrap grid, that would be ideal. But if you need to use floating divs, that's okay too.

Answer №1

To accomplish this task, utilizing JavaScript is recommended.

Take a look at this demonstration

var containerHeight = document.getElementById('upload_prize_form').offsetHeight;
document.getElementById('upload_prize_img').style.height = containerHeight + 'px';

By the way, I stumbled upon this solution here.

Answer №2

To create a table-like style, you can use the following code: http://example.com/table-style

.row {
   display: table;
}

#featured_image
{
   border: 1px solid blue;
   width: 50%;
   display: table-cell;
}

#description_text
{
   border: 1px solid orange;
   width: 50%;
   display: table-cell;
}

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

Missing entry in the dropdown menu rather than the intended selection

Within my HTML code, I am using the following structure: <div class="col-md-8"> @*@Html.DropDownList("templateTypes", (IEnumerable<SelectListItem>)ViewBag.TemplateTypes, new { @class = "form-control", ng_model = "currentTemplat ...

The appearance of the SVG icon changes when it is added to the webpage

I am trying to showcase this svg file (which is a download link) on my webpage. I have attempted doing so using the following code: <img alt="logo" src="/assets/logo.svg"> However, the outcome displays unsightly lines around the central circle, eve ...

Can I retrieve the element of any DOM element I'm currently hovering over using JavaScript?

Suppose I have this HTML snippet: <body> <div id="1"> <span class="title">I'm a title!</span> </div> <div id="2">I'm the first element!</div> <div ...

Heroku Node Crash - ERR_INCOMPLETE_CHUNKED_ENCODING

After developing my app successfully, I encountered some errors upon deploying it to Heroku. The following issues are preventing my page from loading correctly. Can anyone provide assistance? Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING ...

Enhancing a class's properties from its parent component using React

Recently, I decided to dive into React by taking on the challenge of rebuilding the Google Weather app. My main objective is to have the main section update whenever a day is selected. Initially, I believed that updating the props within handleSelectionAt( ...

Tips on positioning content beneath a fixed header or navigation bar when viewed in a web browser

Hi, I'm having an issue with creating a fixed header using HTML and CSS. When I set my header to be in a fixed position, it covers up the content below it. I want the content to be positioned under the header when the page is loaded. Additionally, I&a ...

Locating the nearest image within a specific div using jQuery's find method

Here is the HTML I used on my page: <div class="edge-img-sec"> <img src="img1" alt="edge-icon" class="edge-icon1"> <img src="img2" alt="right-icon" class="edge-icon1-right"> </div> <div class="edge-img-sec"> < ...

Adjust the alignment of the text to match the orientation of the image

When creating a layout with text and an image, I want them to be contained within a parent element that has a specified height, such as 100px. The text should adjust to the content, whether it's a short phrase or a lengthy paragraph, without a fixed ...

JavaScript allows you to create matrices from squares

Hey everyone, I'm facing an issue with creating matrices in HTML. I need to display a 5x5 matrix where each index is represented by a square. I tried using a span template for the box and then wrote a script to populate the matrices, but it's no ...

Problem with integration of Bootstrap datetime picker in AngularJS directives

I am currently utilizing the Bootstrap Datetime picker to display data from a JSON file in calendar format. The data is first converted into the correct date format before being shown on the calendar, with both a To date and From date available. scope.onH ...

Elusive shadow fails to appear in ThreeJS scene

<style> body { margin: 0; } </style> <script async src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0267712f6f6d66776e672f716a6a6f716a6f717a333c343c71">[email protec ...

Tips for preserving CSS layout when incorporating new content in an ASP.NET project

Presented below is a page in ASP.NET. To view the JSFIDDLE code, click on the link provided: http://jsfiddle.net/nyrUp/ HTML <div class="mainContainer"> <div> <div class="topLeft"> <% =DateTim ...

Is there a way to achieve a full-page inset shadow using absolute positioned elements?

Currently, I am facing a challenge with a page that has an inset box shadow on the body element. When there are absolute and relative positioned divs on the page that expand enough to generate a scrollbar, the box shadow is cut off even when the height is ...

The orientation of the rating stars has transformed into a vertical layout

I'm having trouble creating a rating interface that prompts the user to rate the website (by clicking the stars) and leave a comment. The stars are displaying vertically instead of horizontally, as shown in the image provided in the link. I've tr ...

The fixed navigation bar shows a flickering effect while scrolling at a slow pace

Currently facing a challenge with our sticky navigation. Noticing a flickering issue on the second navigation (sticky nav) when users scroll down slowly. The problem seems to be specific to Chrome and Edge, as it doesn't occur on Firefox, IE11, and S ...

Clearing the box-shadow effect when collapsing the side bar using a toggle button

I have been struggling with removing the box-shadow from my sidebar when it collapses. I have tried various CSS methods like box-shadow: none;, box-shadow: none !important;, and box-shadow: transparent;. I even attempted changing the color to box-shadow: y ...

"Modify hyperlink attributes to enhance security and optimize user experience

$("a[href*='youtube']").attr('rel', 'prettyPhoto'); Having some trouble targeting links on a page containing "youtube" in the URL. I'm trying to set their rel attribute to "prettyPhoto" so they open in a lightbox window. ...

I'm unsure of how to eliminate the border outline on this particular text area

The textarea has an unwanted blue outline, and despite trying outline:none; in the CSS, it's still there. See the code below: #floatingTextarea { border: none; outline: none; } <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/ ...

React app version displaying incorrect links to CSS and JS files

I have been immersed in a React project called Simple-portfolio, you can find the GitHub repository here: https://github.com/Devang47/simple-portfolio and the live site at this URL: While everything works smoothly on the development server, I encountered ...

In order to implement the functionality in JavaScript, the .slider::-webkit-slider

I need to create a slider that adjusts the size of the dot based on the value input. For example, when the value is 1, the dot size should be 10px and for a value of 100, it should be 100px. Is there a way to dynamically change the height of .slider::-web ...