Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6888685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:03:29+00:00 2026-05-27T06:03:29+00:00

I want to create a grid layout for a webpage. It should consist of

  • 0

I want to create a grid layout for a webpage. It should consist of nine cells which fit exactly in the current browser window viewport. The center cell should have a fixed width and height and centered horizontally and vertically. All other cells are dynamically adjusted to fit the actual browser window size.

I would prefer a CSS only solution, maybe an open source CSS grid framework. jQuery is fine too, though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:03:29+00:00Added an answer on May 27, 2026 at 6:03 am

    Ok, got it myself: http://jsfiddle.net/alp82/TR6EY/

    HTML:

    <div id="container">
        <div id="top">
            <div id="top-left">
                <h1>TOP LEFT</h1>
            </div>
            <div id="top-center">
                <h1>TOP CENTER</h1>
            </div>
            <div id="top-right">
                <h1>TOP RIGHT</h1>
            </div>
        </div>
        <div id="middle">
            <div id="mid-left">
                <h1>MID LEFT</h1>
            </div>
            <div id="center">
                <h1>CENTER</h1>
            </div>
            <div id="mid-right">
                <h1>MID RIGHT</h1>
            </div>
        </div>
        <div id="bottom">
            <div id="bot-left">
                <h1>BOTTOM LEFT</h1>
            </div>
            <div id="bot-center">
                <h1>BOTTOM CENTER</h1>
            </div>
            <div id="bot-right">
                <h1>BOTTOM RIGHT</h1>
            </div>
        </div>
    </div>
    

    CSS:

    html, body {
        margin: 0px;
    }
    
    #container {
        display: table;
        width: 100%;
    }
    
    #container > div {
        display: table-row;
    }
    
    #container > div > div {
        display: table-cell;
        vertical-align: middle;
    }
    
    #center {
        width: 300px;
        height: 200px;
    }
    
    h1 {
        text-align: center;
    }
    

    JS:

    $(document).ready(function() {
        calculateHeights();
    
        $(window).bind('load resize orientationchange', function() {
            calculateHeights();
        });
    
        function calculateHeights() {
            $('#top, #top > div, #bottom, #bottom > div').css({
                'height' : (($(window).height() - $('#center').height()) / 2) + 'px',
                'min-height' : (($(window).height() - $('#center').height()) / 2) + 'px'
            });
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a property grid (the one which is similar to the
I want to create a asp.net application which can show directions in a layout
I want to create a flexible grid layout (i.e. no pixel value to be
I want to create a really easy to use 2D Grid. Each cell in
I want to have a grid type layout of image views. To begin i
i want to create a Window in an ControlLibrary called MyWindow so that i
I'm using 960 grid system to create a layout prototype. I would like to
I have a grid layout with image nodes and I want to add in
I want this code to do this: Create 4 frames with this layout (dashes
I am wondering if it's possible to create a grid-like layout using div's that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.