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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:58:39+00:00 2026-05-14T03:58:39+00:00

EDIT: There is the almost same question at Removing whitespace between HTML elements when

  • 0

EDIT: There is the almost same question at Removing whitespace between HTML elements when using line breaks , however apart from “float” suggestion I find none of the answers suitable for my requirements. I’d like this to stay open for more innovative suggestions

If you have consecutive inline-blocks white-space becomes significant. It adds some level of space between elements. What’s the “correct” way of avoiding whitespace effect to HTML layout if you want those blocks to look stuck to each other?

Example:

<span>a</span>
<span>b</span>

This renders differently than:

<span>a</span><span>b</span>

because of the space inbetween. I want whitespace-effect to go away without compromising HTML source code layout. I want my HTML templates to stay clean and well-indented.

I think these options are ugly:

1) Tweaking text-indent, margin, padding etc. (Because it would be dependent on font-size, default white-space width etc)

2) Putting everything on a single line, next to each other.

3) Zero font-size. That would require overriding font-size in blocks, which would otherwise be inherited.

4) Possible document-wide solutions. I want the solution to stay local for a certain block of HTML.

Any ideas, any obvious points which I’m missing?

  • 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-05-14T03:58:40+00:00Added an answer on May 14, 2026 at 3:58 am

    You shouldn’t use the version with no space in between elements, just make everything work with space. You’ll probably need to set inline elements to display:block to achieve the correct layout.

    Have a look at this similar question of mine, which has some good answers.

    Edit: One of the answers on the above question suggests using HTML comments as a last resort, e.g.:

    <span>a</span><!--
    --><span>b</span>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: There's now a doc page on this so this question is irrelevant, also
Edit I think there is some confusion, I am not using both of the
There is a similar question going around, but it just got the same old
EDIT: There must be some way I can approach this without writing a whole
**EDIT: There are several options below that would work. Please vote/comment according to your
EDIT - there are no blank lines. EDIT 2 - my bad, it seems
Edit Since there were many downvotes and people who didn't understand what I'm asking
Is there any possible way to edit this code <asp:LoginName ID=LoginName1 runat=server style=top: 165px;
Is there a tool where you can edit a .NET dll directly? .net reflector
Here's the html for my button, according to Chrome: <input checked= type=radio class=edit bindable

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.