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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:16:07+00:00 2026-06-10T22:16:07+00:00

Using styles, want to place two divs in my web application side by side,

  • 0

Using styles, want to place two divs in my web application side by side, like in stackoverflow left side portion is there na like that. i tried like

<div style="width:60%; " >

</div>

  <div style="width:40%; ">    

</div>

but the divs are coming next line to another div, i want the div come side by side with 60 and 40 % width. can you help me

  • 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-10T22:16:09+00:00Added an answer on June 10, 2026 at 10:16 pm

    Whilst I am not keen on the use of floats to align things…you can do this…which splits the screen across two div elements ( a bit like frames )

    <!DOCTYPE html>
    <html>
        <head>
            <title>Template</title>
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            <style type="text/css">
                html, body
                {
                    /* height: 100%; removed as per user comments */ 
                }
    
                .div1
                {
                    background: none repeat scroll 0 0 #FF0000;
                    display: inline-block;
                    /* height: 100%; removed as per user comments */ 
                    width: 60%;
                    float: left;
                }
    
                .div2
                {
                    background: none repeat scroll 0 0 #0000FF;
                    display: inline-block;
                    /* height: 100%; removed as per user comments */ 
                    width: 40%;
                    float: left;
                }
            </style>
        </head>
        <body>
            <div class="div1">
                I am Div1 and this is my content<br/>
                I am Div1 and this is my content<br/>
                I am Div1 and this is my content<br/>
                I am Div1 and this is my content<br/>
                I am Div1 and this is my content<br/>
            </div>
            <div class="div2">
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
                I am Div2 and this is my content<br/>
            </div>
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the new RichTextBox control in SL4Beta and want to create styles for
I want to style selected text differently, and I'm using ::selection to achieve that.
Let's say that I want to use C-style arrays of NSObjects instead of using
I have a few buttons on my page that are styles using sprites, in
I'm using silverlight and I defined two styles for the page: ExpanderBottomRightButtonStyle ExpanderScaleStyle Now
I Want to place a div over another div without using height in pixels.I
I want to place a warning before deleting a specific row from mysql using
I'm using the following to place two pictures next to each other. The pictures
I want to write an application that sends html formatted email. I have the
I want to compile a simple hello-world-style program using the Windows command line. cl

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.