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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:25:30+00:00 2026-06-04T07:25:30+00:00

I want to build a fluid layout using percentages for widths. Here is my

  • 0

I want to build a fluid layout using percentages for widths. Here is my HTML:

<div style="width:50%; display:inline-table;">A</div>
<div style="width:50%; display:inline-table;">B</div>

The problem is that the elements won’t display together on one line. However, the layout works fine if I remove the line break between the them in the HTML:

<div style="width:50%; display:inline-table;">A</div><div style="width:50%; display:inline-table;">B</div>

What is the problem with the first HTML, above? How can I do something like that, but without using absolute position and float?

  • 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-04T07:25:31+00:00Added an answer on June 4, 2026 at 7:25 am

    The problem is that when something is inline, every whitespace is treated as an actual space. So it will influence the width of the elements. I recommend using float or display: inline-block. (Just don’t leave any whitespace between the divs).

    Here is a demo:

    div {
      background: red;
    }
    div + div {
      background: green;
    }
    <div style="width:50%; display:inline-block;">A</div><div style="width:50%; display:inline-block;">B</div>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a Master-Detail layout for one of my applications using SWT.
i want build a blog using jekyll and octopress. but an error happened when
I want to build an local iPhone project without source control using jenkins. However
I want to build a gmail style search app for my site with configurable
I want to build an application using Hibernate and MyBatis integrate with Spring. In
I want to build a search with four search terms. I'm using Kohana 3.0.7
I want to build a webservice using mongodb and lithium. What is better: Store
I want to build a blog with only HTML, meaning that no database, no
I want to build a Cocoa application using the Model-View-Controller design pattern. I have
i want build a photography app with effects . e.g. old images with brown

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.