A structured design approach combining fixed and fluid elements tailored for the 960.gs framework

Our website is designed using the 960.gs grid system, and I am attempting to customize it into a 3-column layout with Fixed(100px) - Fluid(max width) - Fixed(100px) view. However, most online generators for 960.gs grids only offer fully fixed or fully fluid options. I am trying to modify the originally generated full-fluid grid into this desired layout:

<------------100%--------------->

======== =============== ========
| fixed| |max to screen| |fixed |
======== =============== ========

<-100px>                 <-100px>

The modified code can be viewed here: http://jsfiddle.net/vZm8x/

  • Issue 1) I am unsure how to make the central content area expand to the maximum width allowed by the screen. Using width:auto; does not work, and setting width:100% causes the divs to wrap.
  • Issue 2) After fixing the width to 100px, all divs continue wrapping downwards. Setting display:inline; does not resolve the issue. Any suggestions?

My question is: Is it possible to tailor the 960.gs template to suit our specific requirements? If so, could you please provide guidance on how to address these issues? Thank you in advance!

Answer №1

Creating fixed-width side columns is a simple task. Using floats and potentially a faux columns trick for specific design requirements can help achieve the desired layout.

The structure to implement would resemble this:

<div class="left"></div>
<div class="right"></div>
<div class="middle">Content</div>

Incorporating CSS properties like below will aid in defining the widths of the columns:

div {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.left {
    float: left;
    width: 100px;
    background: #f00;
}

.right {
    float: right;
    width: 100px;
    background: #00f;
}

.middle {
    width: 100%;
    padding: 0 100px;
    background: #ccc;
}

To see this layout in action, check out this demo link. The content remains within the defined column boundaries even when adjusting the section's width.

Note that placing the content column last in the HTML structure prevents overlap with the side columns due to document flow.

Alternatively, utilizing position: absolute; on side columns offers another approach:

.wrapper {
  position: relative;
}

.left {
  position: absolute;
  top: 0;
  left: 0;
}

.right {
  position: absolute;
  top: 0;
  right: 0;
}

.middle {
  padding: 0 100px;
}

div {
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

These techniques are compatible with modern browsers but may require adjustments for older versions like IE7. However, workarounds exist to address compatibility issues if needed.

The position: absolute method provides flexibility in arranging sidebars before or after the content div, offering a more semantic option compared to floating elements.

Overall, these strategies effectively handle fixed-width side columns by manipulating document flow and positioning elements accordingly.

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

What could be causing the hover effect to not work on the cards in my Svelte component? (HTML+CSS)

Greetings everyone! This is my debut post on this platform, and I'm in urgent need of assistance as I am relatively new to the world of programming. I've been trying tirelessly to implement a hover effect on these cards, but for some reason, it ...

Transforming HTML 'img' elements into React components without losing styling: How do I achieve this with html-to-react?

I am seeking guidance regarding the usage of the html-to-react library. Consider the following html string: '<div> <img src="test.png" style="width: 100px;"/> <img src="test2.png" style="margin: 0px 4px;"/> </div>' ...

Tips for inserting a button under a div when clicked

I am working on a layout where I have several div cards aligned side by side using the display: inline-block property. What I want to achieve is that when I click on a card, a button is added below the respective div. To accomplish this, I tried using jqu ...

How to center a label vertically within a button group using Bootstrap

How can I vertically align labels for 2 inline elements inside a horizontal form without using hacks like display:table? So far, this is the code I have tried: bootply ...

Exploring JavaFX and FXML TreeTableView customization for column and header styles

I've been working on a JavaFX project and I'm having trouble customizing the style of the TreeTableView header or columns, like changing the color, width, font size, etc. I've tried using various codes like these but none seem to work. ...

The Safari browser is plagued by a flickering issue with CSS perspective flip animations, even when using the back

I'm facing an issue with Safari (both desktop and iOS) related to a simple CSS flip animation. Despite searching through similar posts and answers, I haven't found a solution yet and am in need of a fresh perspective. Essentially, I am creating ...

CSS auto width not applied to images causing a lack of scaling

I recently added this code to my webpage: image { margin: 0 2px 0 0; height: 100px; width: auto !important; overflow: hidden; text-align: center; } The goal was to scale all images to a maximum height of 100px and have the browser adj ...

Issues arising from script tags causing disturbances in CSS

As a newcomer to the world of web design, I recently embarked on a journey with Bootstrap and also started exploring the platform Codepen. However, after working on a project in Codepen and attempting to transfer my code to Sublime, some unexpected changes ...

Transition into animated borders using <hr> lines

While working on a basic static website using Bootstrap 5, I encountered an issue with the animations in the full-screen carousel. The Navbar, Title text, and subtext fade in smoothly as intended. However, I faced challenges trying to apply similar animati ...

What is the best way to align the navbar-brand link in the middle of a Bootstrap 4 navigation bar?

This question may seem like a duplicate, but it is not. I am specifically asking about Bootstrap version 4.3 and not any earlier versions. The answers I have found so far are either not applicable to the current version (useless for updated projects), or ...

Footer alignment issue when using react-full-page is causing it to not lineup at the bottom of the page

Currently, I have integrated the react-full-page package into my project. However, after adding the Footer to the routes, I noticed that the footer is only visible in the second section of the page and does not appear at the bottom as expected. If you wan ...

Designing a circular pie navigation interface using HTML that draws inspiration from the sleek and intuitive pie navigation found

I am on a quest to create a unique pie navigation for my website, inspired by the design seen in Paranoid Android. When the navigation button is clicked, I envision the pie expanding with the first set of menus fading the background like a lightbox. Upon ...

The background image fails to load the specified image

I am encountering an issue with utilizing background-image in the style of my HTML page. I am currently developing a login page for my Django application, and when I preview the page, the background image does not appear. Strangely, this code was functioni ...

Ensure the navbar includes the .container class and insert an extra dropdown right next to the container without causing any misalignment

Desired output: Achieve two rows with a .container div, centered in the viewport and aligned with each other. The second row should contain the navbar within a .container. Additionally, add a non-collapsing dropdown at the end of the navbar row, outside th ...

What steps should be followed in order to replicate the border design shown in the

Checkboxes Border Challenge I am looking to connect the borders between my checkboxes. I attempted to use pseudo-borders, but encountered issues with setting the height for responsiveness across various screens. If anyone has suggestions on how to tackl ...

Collaboration of Bootstrap components

I am facing an issue with two divs that are supposed to be displayed side by side in a normal browser. However, when the browser window is resized, the first div loses its height and the second div overlaps into it. I attempted to set the body's min h ...

When padding is added on an MVC 5 page, the Bootstrap 4.1.1 class option for rounded-circle becomes distorted

Incorporating VS 2017 and bootstrap 4.1.1 into an MVC 5 page, I am facing a challenge in adding right-side padding to an image without distorting the circular shape of the image, as shown below. When I apply the padding, the circle becomes warped, but remo ...

The circular shape of a border-radius becomes distorted when scaling at various browser zoom levels

My challenge involves a small circle with a 4px diameter that I need to scale using anime.js. While it works perfectly at 100% zoom (default), I also require it to behave consistently across different zoom levels, specifically from 50-100%. To see the iss ...

Dividing a pair of CSS stylesheets on a single HTML page

Currently, I am working on a HTML page that includes multiple javascripts and css files in the header section. <link href="@Url.Content("~/Content/css/main.css")" rel="stylesheet" type="text/css" /> In order to make the website mobile-friendly, I s ...

What is causing col-xs-0 to occupy the entire width of the row?

Here is the structure of my Bootstrap container: <main > <div class="row co-lg-12 col-md-12 col-xs-12"> <div class="col-lg-1 col-md-1 col-xs-1" style="background-color:red; height: 100vh;"></div> <div class="col-lg-4 col-m ...