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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:22:23+00:00 2026-06-18T19:22:23+00:00

I’m having issues with serving a website on mobile devices, as the whitespace (including

  • 0

I’m having issues with serving a website on mobile devices, as the whitespace (including new lines) is stripped from the HTML.
This is a problem, as it shifts the positions of the inline-block elements. (see here for information on the issue).

Eventually I resorted to a workaround (got rid of whitespace between inline-block elements in the first place, and then adjusted CSS positioning), but now I want to figure out why this is happening.

Website details:

  • Platform: Ruby On Rails 3.2.11 (MRI 1.9.3)
  • Template Engine: ERB
  • Rack Server: Thin (1.5.0)
  • Host: Heroku (Cedar)

Since I am not even sure if this is a rails/rack/heroku related problem, I created a dummy duplicate:

  • Copied the rails-generated HTML to a static *.html file (and adjusted CSS and JS links)
  • uploaded that file on another machine (Apache), to serve it as a static HTML file

And I did some tests. Well… the results are (almost) the same.
If I send GET requests with curl, I get what I described above for both websites (the dynamic rails application and the static HTML file):

  • using my landline connection I get the full “raw” HTML, with whitespace, newlines and indentation.
  • using my carrier 3G connection (in tethering), I get the HTML code stripped of every whitespace, just like minified CSS or JS. (btw, the same happened when I double-checked with any other website, from google.com through xkcd.com)

YET, when browsed with my mobile, everything is rendered normally on the dummy static one.

I honestly can’t figure out where the problem is. Since curl always gets minified HTML on 3G, I’d think the problem is on the network. Yet, the smartphone only complains when the page is served by Rails.

Has anyone ever encountered this issue?

  • 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-18T19:22:25+00:00Added an answer on June 18, 2026 at 7:22 pm

    I checked your blog entry. Using spaces to format you layout or using is the wrong approach and will never be reliable. if you really have to then use non breaking spaces in html.

     
    

    It is far better to put classes on your elements and then use CSS to set margins and padding. Your workaround was in fact the correct thing to do.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,

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.