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 8390239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:55:50+00:00 2026-06-09T18:55:50+00:00

I am creating a sample website which has three divisions horizontally. I want the

  • 0

I am creating a sample website which has three divisions horizontally.
I want the left most div to be 25% width, the middle one to be 50% width, and right to be 25% width so that the divisions fill all the 100% space horizontally.

<html>
    <title>
    Website Title
    </title>

    <div id="the whole thing" style="height:100%; width:100%" >

        <div id="leftThing" style="position: relative; width:25%; background-color:blue;">
            Left Side Menu
        </div>

        <div id="content" style="position: relative; width:50%; background-color:green;">
            Random Content
        </div>

        <div id="rightThing" style="position: relative; width:25%; background-color:yellow;">
            Right Side Menu
        </div>

    </div>
</html>

https://i.stack.imgur.com/NZDJe.jpg

When I execute this code, the divs appear over each other. I want them to appear beside each other!

How can i do this?

  • 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-09T18:55:51+00:00Added an answer on June 9, 2026 at 6:55 pm

    I’d refrain from using floats for this sort of thing; I’d rather use inline-block.

    Some more points to consider:

    • Inline styles are bad for maintainability
    • You shouldn’t have spaces in selector names
    • You missed some important HTML tags, like <head> and <body>
    • You didn’t include a doctype

    Here’s a better way to format your document:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Website Title</title>
    <style type="text/css">
    * {margin: 0; padding: 0;}
    #container {height: 100%; width:100%; font-size: 0;}
    #left, #middle, #right {display: inline-block; *display: inline; zoom: 1; vertical-align: top; font-size: 12px;}
    #left {width: 25%; background: blue;}
    #middle {width: 50%; background: green;}
    #right {width: 25%; background: yellow;}
    </style>
    </head>
    <body>
    <div id="container">
        <div id="left">Left Side Menu</div>
        <div id="middle">Random Content</div>
        <div id="right">Right Side Menu</div>
    </div>
    </body>
    </html>
    

    Here’s a jsFiddle for good measure.

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

Sidebar

Related Questions

I am creating one sample project in android. i am using sample rss feed.
I am creating a website as a mini project which will be used to
I am creating a simple(ish) website for one of my iPhone apps using the
I am creating a blog based on the 960 grid system. It has three
For a homework project, I'm creating a PHP driven website which main function is
I am trying out ASP.Net MVC2 by building a small sample website which, amongst
I'm creating a website using Entity Framework (4.1), which exposes WCF services, and I
I am creating an internal website for my company in which everybody who will
I am creating an interactive colour sampler for a web site, which has 16
I'm new to the .Net world. I'm creating a website. It has DAL &

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.