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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:50:27+00:00 2026-06-15T19:50:27+00:00

Say I have <span class=ib-half></span> <span class=ib-half></span> and .ib-half { display: inline-block; width: 50%;

  • 0

Say I have

<span class="ib-half"></span>
<span class="ib-half"></span>

and

.ib-half {
    display: inline-block;
    width: 50%;
}

I expect the two spans to display side-by-side but they won’t. There’s no margin, padding, or border, so what’s the problem?

  • 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-15T19:50:28+00:00Added an answer on June 15, 2026 at 7:50 pm

    The actual problem is the space (newline) between the two elements. Because it’s an inline-block element, it registers the space, so it’s 50% + the space.

    Some possibilities:

    <span class='left'>Left</span><!--
    --><span class='right'>Right</span>
    

    or <span class='left'>Left</span><span class='right'>Right</span>

    or

    <span class='left'>Left</span><span
    class='right'>Right</span>
    

    or to me it really probably makes the most sense to float: left; and change it to a display: block element. I believe the nature of inline elements is to operate in the same manner as text with some extra spacial information, so why get hacky when there’s no reason to?

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

Sidebar

Related Questions

Say I have this HTML fragment <td width=25% style=text-align:right; > <span style=font-family: Arial; font-size:
Let say I have, <span class=labels style=background-color: #FFFFFF;border: 1px solid #000000;font-family: Verdana;font-size: 11px; >74.58
Let's say I have a list like this: <ul class=list> <li><span class=pos><div class=txt_pos>1</div></li> <li><span
Lets say i have the following web page: <html> <body> <div class="transform"> <span>1</span> </div>
say I have a css class name div.TestClass { float:left;etc// } span.SpanTestClass { float:right;etc//
lets say i have this lump of HTML: <div class=container> <span class=title>Heading 1</span> This
say you have this html <ul class=nav sub_nav_home> <li id=sub_nav_home1><a href=#><span>LINK1</span></a></li> <li id=sub_nav_home2><a href=#><span>LINK2</span></a></li>
Let's say we have the following html: <ul id=portfolio-list class=clearfix span-24> <li class=2012#foo bar
Say I have an element in my HTML page like so: <span class=special caption['This
Let's say I have some hyperlink but class and id of it are already

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.