a pair of liquid divs aligned next to each other

I am attempting to line up two fluid divs next to each other. You can see a preview of the current layout here. My goal is to have two flexible divs side by side.

This is the code I currently have:

.images {
  border: 1px solid red;
  position:absolute;
  top:40px;
  left:0px;
  float:left;
  width: 25%;
  min-width: 305px;
  height: 95%;
}
.content {
  border: 1px solid blue;
  position:absolute;
  top:40px;
  left: 25%;
  width:70%;
  min-width: 60%;
  height: 95%;
}

My desired outcome is as follows:

Images: takes up 25% of the screen

Content: takes up 75% of the screen

However, when the user resizes their screen, I want the divs to expand but not shrink beyond a certain point. I have looked into using flexboxes, but there isn't widespread support for them yet. I have also tried using "flex-flow: row" without much success. Since I am already using Bootstrap on the site, a solution within Bootstrap would be ideal. Any assistance would be greatly appreciated.

Answer №1

If you're looking to enhance your website for different screen sizes, consider diving into responsive design. Implement a fluid layout for larger screens and a fixed layout for smaller screens. Explore media queries to get started.

Answer №2

To ensure proper alignment of one div to another using the "float:left" property, remember to apply the same property in both div's rules. If this is not done, they will be displayed on the same line and may cause unexpected positioning. The first div will align to the left, which could lead to misalignment if the second div does not also have the "float:left" property.

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

Image alignment

Currently, I am designing a website that requires an image to be centered in the left side of a div, aligned with the right div which has a background. I attempted a common solution, but unfortunately it is not functioning properly. The design must also be ...

Arrange elements using jQuery's draggable feature post drag and drop

I am working on creating a list of 10 draggable items, stacked from 1 to 10 from top to bottom. If a user decides to drag an item from position 1 to position 5, I aim for all the items to shift up by one position. Similarly, if a user moves an item from p ...

Uploading a JSON file with several input files simultaneously

While attempting to upload multiple files with the provided codes, I encountered an issue where the response from the first Input File appeared in the second Input File and vice versa. Here are the codes I used: CSS and Script: <script src="https ...

What is causing the discrepancy in height between my parent DIV and its children?

I've been grappling with this issue for quite some time now and unfortunately, I haven't been able to come up with a solution. Within my design, I have a frame that consists of a top box, a left box, a right box, and a middle box that contains th ...

Java - Avoid overwriting files by renaming duplicated files instead of the selected file

Situation - I have a script called TableToCSV that is designed to convert a .html table file to a .csv file. However, it requires the user to input a file with a .html extension through the console. The issue is that the files selected often have a .xls ex ...

Using PHP to send fully formatted HTML emails

How can I use PHP mail function to send an email, but ensure that my HTML content is displayed correctly instead of being sent as plain text? Below is the code that I am currently using: $from = '<a href="/cdn-cgi/l/email-protection" class="__ ...

Encountering the error [object Object] when passing variables through Ajax, jQuery, and JSON

I am having an issue passing an array with JSON in PHP: $array = array ($a, $b, $c); echo json_encode($array); and then trying to utilize it in jQuery like this: $(function () { $.ajax({ url: 'api.php', data: "", da ...

Exploring the intricacies of Knockout JS mapping nested models using fromJS function

I am struggling with understanding how to effectively utilize the Knockout JS Mapping Plugin. My scenario involves nested models, and currently I am only using the ko.mapping.fromJS() in the parent model. However, I have noticed that the computed values ar ...

How can I implement a single Ajax call to load content from various pages and display it

This code facilitates an ajax call to dynamically change the content of a div in the main page without requiring a full page reload: function ajaxcall() { $.ajax({ type: "POST", url: "/create.php", success: function( returnedDa ...

Selector for the Nth child element

Struggling with the nth child selector. Here is the HTML snippet: HTML <div class="container"> <ul class="mh-menu"> <li> <a href="#"> <span>Chairman of the Board</span> <spa ...

Step-by-step guide for installing the source code of Bootstrap v3.3.5

Previously, I was utilizing version 3.3.4 of Bootstrap with a source code package that worked perfectly fine. Now, I am attempting to upgrade to version 3.3.5 but encountering issues. Here are the steps I have followed: I downloaded the zip folder for v3. ...

Database table entry form

I'm attempting to create a form that sends the index.php input to my database table using index.php and connection.php. I also want to set everything else to be in letter format except for the phone number (puhelinnumero), which should be in numeric f ...

Choose CSS Option

I need assistance with customizing my dropdown select option - see the example below <select> <option value="volvo" title="NEED THIS BIGGER AND FORMATED" >Volvo</option> <option value="saab">Saab</option> <option val ...

Transform URL Structure with UrlRewrite and htaccess - A Step-by-Step Guide

Currently, I am using the following URL: http://server.com/index.php?page1=main&page2=contacts I would like to change it to: http://server.com/main/contacts Can anyone provide guidance on how to write an .htaccess file with sample code for this red ...

Getting a 400 error in Flask app while attempting to add a second variable to Ajax data

I am attempting to utilize Ajax to manage forms in my Flask application. Below is the snippet of code I am currently using: Flask/Python: @main.route('/reply/', methods=["GET", "POST"]) def reply(): if request.method == "POST": rep ...

Conceal a div element using a button through JavaScript

I've been scouring various online resources for solutions, including Stack Overflow and W3Schools, but I haven't had any luck so far. Here's a simplified version of my current code: <script language="javascript"> function remove() ...

Having trouble with the functionality of Angular 2 filter and toggle features?

I recently developed a hamburger menu with a toggle function to display subcategories. Everything was working smoothly until I applied a filter. Once I search for a category using the filter, the toggle function stops working. Here is a snippet of my HTML ...

Retrieve the outer-HTML of an element when it is clicked

I am working on a project to develop a tool for locating xpath, and I am seeking the most efficient and user-friendly method for allowing the user to select the desired element on a webpage. Ideally, this selection should be made with just a single click, ...

Explore our collection of videos featuring exclusive content on our video gallery. Please note

I am attempting to create a video gallery using YouTube videos. Here is the current code I have: //html... <div id="videogal" ></div> //javascript //initializing the gallery //mplv is an array, retrieving data after a database query //mplv[ ...

ending the AJAX request in servlet

I have designed a login form: <div class="top1"> <span id="book_store">Book Store</span> <div class="login_signup_form"> <input type="email" id="email_id" placeholder="Email" name="email" /> <input ...