stop automatic resizing of windows

  • My CSS is written using percentages.
  • I need to maintain the percentages intact.

Is there a way to stop the layout from changing when the browser window is resized?

I want the percentages to remain unaffected, even when the browser window is being resized.

Answer №1

To utilize percentages without them being dependent on the window size, you will need to enclose them within a fixed-width (or at least a max-width) container:

<div id="container">
    <div id="column-left">
    </div>
    <div id="column-right">
    </div>
</div>
#container {
    width: 1000px;
}

#column-left {
    width: 30%;
}

#column-right {
    width: 70%;
}

Check out the demonstration here: http://cssdesK.com/3gJNj

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

I am interested in creating a design where two DIVs are layered on top of each other with one having transparency, allowing visibility through to the background DIV. This can be achieved using a combination of

Looking to enhance the visual appeal of my website, I decided to incorporate a background image within a div. To add more depth and creativity, I am now striving to overlay a semi-transparent black box on top of the image. This overlay will not only allo ...

What is the best way for me to collect messages submitted through a form on my website?

After completing my website using HTML, CSS, and JavaScript, I added a form with inputs for name, email, and message at the bottom of the page. Now, I am trying to figure out how to receive the information submitted by visitors in my email. ...

Display an icon to act as a separator between icons in CSS styling

Is there a way to display a spacer line before and after icons (cross symbols) while excluding the spacer line before and after buttons carrying the word "Cancel"? How can this be achieved? This is my CSS file: .Container > *:first-child::before, .Con ...

An error of type 'System.Web.HttpException' occurred during the file upload process to the server

Recently, I have started learning about asp.net, ajax, and c#. I am attempting to save an image on the server using the example below: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> ...

Having difficulty accessing POST data through $.ajax request

I am currently working on a simple JavaScript code that is set up to send POST requests to my local server. The JavaScript and PHP files are both located on localhost, so I don't have to worry about any cross-site issues for now. Here is the JavaScrip ...

Enhance the styling of elements generated through JavaScript in VueJs with custom CSS

I need help applying CSS to elements that I dynamically created using JavaScript. buttonClicked(event) { console.log(event); let x = event.clientX - event.target.offsetLeft; let y = event.clientY - event.target.offsetTop; let ripples = document.cre ...

Maintaining Existing Filters and Incorporating Additional Filters in React/Next.js Data Filtering

I'm currently facing a challenge with filtering data in React/Next.js. The issue I'm encountering is that whenever I set a new filter, the previous filters get removed. For instance, if a user performs a search, it works fine but the tag filters ...

Error encountered in NEXT JS: Unable to parse URL from /api/projects or Error message: Failed to connect to 127.0.0.1:3000

Currently utilizing: export const getStaticProps = async () => { export const getStaticPaths = async () => { and accessing my API (pages/api/projects/) created with Next.js on my local host const res = await fetch("http://localhost:3000/api/ ...

What is the best way to patiently wait for a promise to fulfill, retrieve its value, and pass it to another function?

I am facing an issue with getting the value of stringReply into my app.post method in Express. From what I understand, it seems like the code is fully executed before the promise is resolved, resulting in an undefined value when attempting to log stringR ...

How the logo's placement shifts while zooming out (using CSS and Angular 4+)

I am facing an issue with my navbar that includes a logo (MostafaOmar) which shifts position when zoomed out. If you try zooming to 70%, you will notice the logo's position changes as well. Is there a way to make it stay in place at 100% zoom? Here ...

Tips for managing a multi-page website with AngularJS

Currently, I am embarking on the development of an Android application using Cordova. To interact with the service end-point of a Drupal website, I have opted to utilize AngularJS for data fetching and manipulation. Initially, my attempt to incorporate ngR ...

Describe the ng-model for this specific JSON input array in AngularJS

Aim: The task at hand is to update the data in the following format: "open_hours": [ // (Note that open_hours is an array). { "weekday": "mon", "opens_at": "09:00", "closes_at": "22:00" }, { "weekday": "t ...

Why does my computed property become undefined during unit testing of a head() method in Vue.js with Nuxt.js?

In my Vue.js + Nuxt.js component, I have implemented a head() method: <script> export default { name: 'my-page', head() { return { title: `${this.currentPage}` }; }, ... } </script> ...

Curved lines on canvas

I am currently using the stroke and path features in the canvas to create two lines, with the intention of giving them a curved, wave-like effect. I would like to achieve this without having to create an actual image in Photoshop. Is there anyone who can ...

Problem with extJS portal functionality

Currently, I am utilizing this particular URL for my application: . I attempted to swap out the existing chart in the third column with a bar chart and a pie chart (both of which work fine within panels and windows), but I encountered an "h is undefined" e ...

Utilizing Express JS: Invoking a function within my class during routing operations

Currently, I am in the process of developing a MERN Application using Typescript. I seem to be encountering an issue with this within my class. When utilizing this code snippet: router.post("/create", user.createNewUser); It becomes impossible ...

Implementing automatic activation of a tab upon page load using Angular

I am currently working with a set of Bootstrap nav pills in my navigation bar. The 'ng-init' code in my Angular script sets the 'dateState' to 'past' on page load. However, I have noticed that the 'Past Events' nav p ...

Using a number input with step increments of 0.01 in AngularJS can result in undefined values for specific inputs

An issue arises when using a specific type of input in angularjs (1.6.1) where the values between 9.03 to 9.05 inclusively return undefined. This problem also occurs with other values like 9.62, 9.63, and 17.31. <input type="number" step="0.01" data-ng ...

Directive for Angular JS that creates a custom table

Working on a project that involves a significant amount of serial true/false data to be displayed in various ways. Developed a directive to pass in the model, table header, and an important aspect - the number of columns. <serial-checkbox-table title=" ...

Instructions for changing the background color of a value

I'm working with a code that populates values in table columns, but the text displays in black color. I would like to highlight the text with a blue background. Here is the HTML code snippet: <body> <div class="container"> ...