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

  • Home
  • SEARCH
  • 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 9082043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:27:46+00:00 2026-06-16T20:27:46+00:00

I have a simple webpage consisting of 3 DIVs. I need a descent CSS

  • 0

I have a simple webpage consisting of 3 DIVs. I need a descent CSS styles that would do the following:

top and bottom divs have to be of fixed minimal width (e.g. 20 px, if not possible, down to 0 px).

middle div should be of fixed width, eg 1000 x 700 px.

When I set fixed width/height for every div, everything is fine except the screen is not stretching. If I set top and bottom divs height to auto, I have second (fixed size) div to be attached to the top side of the screen, and top div size is 0, also bottom size di is strange size.

HTML code with all CSS attributes:

<body style="background-color:#030303; margin:0px; padding:0px;">
<!--head-->
<div style="margin:0 auto; width:100%; height:auto; border:0px solid red; background-color:#181818; position:relative;">
 (some images)
</div>
<!--gallery-->
<div id="galleria" style="height:700px;width:1000px; margin:0 auto; border:1px solid green;   ">
    <a href="img/img1.jpg"><img src="img/thumb1.jpg" data-title="My title" data-description="My description"></a>
    <a href="img/img2.jpg"><img src="img/thumb2.jpg" data-title="Another title" data-description="My <em>HTML</em> description"></a>
</div>
<!--footer-->
<div style="  margin:0 auto; top:0px; width:100%; height:auto; position:relative; border:1px solid red; line-height:128px; background-color:#181818">
    <div align="center" >
     (some images)
     </div>

</div>
</body>
  • 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-06-16T20:27:47+00:00Added an answer on June 16, 2026 at 8:27 pm

    Your question is a bit confusing (when you say width, do you mean height?). If I understand right, you want the three divs to add up to the total height of the viewport. I know of two ways to do this — with absolute positioning or with display: table styles. In my experience, the first is more efficient.

    <div id="topbar">Top</div>
    <div id="mainarea">Middle</div>
    <div id="footbar">Botton</div>
    
    #topbar, #mainarea, #footbar { position: absolute; overflow: auto; }
    #topbar { height: 20px; top: 0; left: 0; right: 0; }
    #mainarea { top: 20px; left: 0; right: 0; bottom: 20px; }
    #footbar { height: 20px; left: 0; right: 0; bottom: 0; }
    

    If you want to actually assign a width, too, then get rid of the ‘right’ styles and assign the same width to all three (it’s generally unwise to force a width on people, though).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Web Browser Control that displays a local webpage and that
I have a simple webpage that takes query items and crafts them in to
I have a simple program that i can open a webpage and i paste
I have created a simple webpage that launches a widget after a button is
I have a simple webpage that uses the jquery template plugin to dynamically load
I have a simple html/css webpage: www.eveo.org All my content is located in my
I have a simple webpage that adds & deletes options from a select element
I have a simple asp.net webpage that contains of 2 RadioButton lists. When the
I have a simple webpage that serves as an introduction to a more complex
I have a simple javaFX application that loads a webpage in a WebView componant.

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.