What can I do to keep the divs in position when resizing the screen?

I've noticed that the list items are shifting out of place when I resize the screen. I want them to stay in their original position no matter the screen size. I suspect it has something to do with the .fixedwidth class, but I've been struggling to fix this issue. Here's what my code looks like: View the code.

<!doctype html>
<html>

...

Answer ā„–1

Make sure to include this code snippet within the body tag of your HTML document. By setting a minimum width for the containing element, you can prevent elements from shifting or moving around when users resize the page:


body {
    ...
    min-width: 1200px;
    ...
}

By locking the page width at 1200px (tested on various screen sizes), you ensure that the body and its contents remain fixed in position even as the viewport size decreases.

Answer ā„–2

Avoid using percentages and opt for a defined width when styling the .fixedwidth class.

Alternatively, consider taking the responsive design approach instead ;)

Answer ā„–3

Try including the following in your body{} and check out the demo on fiddle http://jsfiddle.net/DIRTY_SMITH/1j7xter3/8/

   body {
    margin: 0;
    background-color: white;
    font-family: Arial,Helvetica,freesans,sans-serif;
    overflow: scroll;
    width: 1200px; 
    }

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

Align Text Center inside a Magical H1 Heading Tag

I'm having a bit of trouble with something that should be simple. I want to center the text inside my h1 tag on a wizard, and I've added this CSS to my stylesheet.css: .h1textalign { text-align:center; } Here's how I'm trying to apply ...

The CSS selectors wrapped in jQuery vary between Chrome and Internet Explorer 11

When utilizing a jquery wrapped css selector such as $($("#selector").find('input[type="textarea"])'), I am able to input values into the textarea in Chrome using $($("#selector").find('input[type="textarea"]).val(someValue)') but encou ...

`How can I activate a modal window when an option is chosen?`

Utilize the select tag and modal window tag for this example. <select id="selectBox"> <option value="0">Select</option> <option value="1">Yes</option> <option value="2">No</option> </select> <div id ...

Tips for Removing Padding in Material UI Container Component

I'm currently working on creating a hero banner using the material-ui framework and I've encountered an issue. Here's what I have so far: https://i.stack.imgur.com/UXTDY.png However, I'm facing an irritating problem with left and rig ...

Obtaining the API for a website's functionalities

Iā€™m in need of downloading the API file that facilitates the connection between the website and database. How can I achieve this? I've attempted to use Httrack, wget, and open explorer, but they only seem to download the website itself. While I get ...

Customizing the default image of a Select dropdown field in Sencha Touch

Does anyone know how to change the default image of a select dropdown in Sencha Touch to a customized image? I've attached a screenshot for reference but can't seem to find any properties or classes to adjust this. Any guidance would be greatly a ...

Tips for maintaining a sticky header while continuing to utilize Bootstrap table classes such as table-responsive and table-stripped

This is Here's my code on jsfiddle I've attempted to make the header sticky while maintaining the current layout, but every approach I've tried ends up messing with the responsiveness of the table. My next plan involves using a JavaScript ...

.htaccess file encounters an error when attempting to incorporate an argument related to HTTP 451

My website includes a .htaccess file with the following contents: <Files .htaccess> order allow,deny deny from all </Files> ErrorDocument 404 /websites/404/index.php Adding additional ErrorDocument lines should work, like so: <Files .hta ...

What are the best ways to improve the rendering performance of this specific HTML code snippet

<table> <tr> <td><img src="http://www.foo.com/a.img"></img></td> <td><img src="http://www.foo.com/a.img"></img></td> <td><img src="http://www.foo.com/a.img"></img&g ...

Ensure the left column extends all the way down

I've been struggling with this issue for almost three days now. After reading numerous articles on creating a three-column layout and experimenting with absolute and relative positioning, I'm still not able to achieve the desired result. What I& ...

Retrieving HTML tag content using Javascript

I'm searching for a JavaScript code that can scan all the HTML files in my main directory and subfolders to extract content located within a specific tag, like this: <div id="content"> !!this content!! </div> Additionally, it should only ...

Guide to implementing a feature where clicking on a specific section of the background image triggers a transition to another website using HTML

Is it possible to set up a background image with clickable regions that direct users to specific websites? ...

I kindly request your assistance in resolving the issues with the append() and empty

Here is some code I've been working on: <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ ...

Having trouble adjusting the image size in the Semantic UI Feed Summary component

Currently experimenting with the example code to expand my knowledge of Semantic UI. The Feed view caught my eye, but I am interested in adding another avatar/mini image at the end of my summary line. While I can successfully insert the additional image, I ...

How to align a div vertically in relation to another div with automatic height

My challenge is to create a vertically-aligned div in connection with an auto-height div. It's difficult to explain, so I've included a screenshot that should clarify things: The orange div represents the main container. The blue div is a 2n ...

Ensuring the height of the body and content div in Bootstrap 4 combined with Angular set to

Is there a way to center the <div class="card"> in the middle of the page or body? It works perfectly on a desktop browser, but on mobile view, it's not aligning properly. How can I center it using... html, body { height: 100%; background: ...

Designing a hierarchical HTML dropdown menu for choosing an XML file for parsing using a jQuery script

I have successfully created a question and answer framework using Jquery and XML files. Users can choose a specific category of questions from a drop-down menu, which then displays the corresponding questions and answers from the selected XML file. While ...

Is there a way to conceal the loading screen until the website has completely loaded?

I've been working on my personal portfolio/website and encountered a bug that I can't seem to fix on my own. The issue is with the logo (aa) and text under it showing even after the content page has fully loaded, taking around 3 seconds to hide. ...

Unusual Happenings with jQuery Draggable

Currently, I am experimenting with jQuery draggable to move individual letters of the word "Hello" around on the page. However, I have come across a frustrating issue. When I drag the letter H towards the right and it gets near the letters E, L, L, or O, ...

Retrieve an image using screen resolution parameters [using only HTML]

During a recent interview, the interviewer posed an interesting question regarding 2 images: There is one large resolution image that needs to be displayed on laptops and desktops. There is also a small image that should only be shown on mobile devices. ...