44549

Respect space in code but ignore   with CSS?

Question:

With CSS can I make a browser ignore the   character but respect normal white space?

So this:

Some text   More text

Is displayed like this:

Some text More text

Not:

Some text   More text

UPDATE There is actually more white space in my code. I need the default behavior where extra white space doesn't get rendered on the page so I dont think I can use white-space: pre or pre-wrap

So this shouldn't be excessively indent before the initial word.

Some text   More text

Answer1:

I don't think there's a pure CSS way of doing that, since   is an actual character that is different from the whitespace created by the spacebar in a text editor (what gets ignored by HTML renderers). However, depending on how those are appearing, you may be able to use a script that searches for and removes that character wherever it sees it.

Recommend

  • Anybody have any idea how the divs are emitted in pinterest.com?
  • Setting color in a row of a Jtable
  • Devise: undefined method `user_signed_in?' for ApplicationController:Class
  • 1º Day of Daylight Saving Time Java and JS showing a different behavior
  • SPARQL queries doesn't works without LIMIT clause
  • Conditional render in tagfile depending on whether the attribute is specified or not
  • Is Android's ARGB_8888 Bitmap internal format always RGBA?
  • How do I embed a custom user-control in MS Word?
  • Conversion from C++ to Delphi (simple)
  • When HTTP-POST has body, url parameter is null
  • Is there a chance to get -splash: work for SWT applications that require -XstartOnFirstThread?
  • What's wrong with `var myEval = eval; myEval(“2+2”)`
  • css background images not always displayed
  • How to open multiple instances of a program in Linux
  • PyQt4 application on Windows is crashing on exit
  • text-align justify, cannot override
  • You tube videos are not playing
  • Issue with routerLink directive
  • Compare struct to a constant in C
  • Wrong labels when plotting a time series pandas dataframe with matplotlib
  • jQuery: add elements until a particular height is reached
  • Android application: how to use the camera and grab the image bytes?
  • Reduction and collapse clauses in OMP have some confusing points
  • AJAX Html Editor Extender upload image appearing blank
  • Projection media query: browser support and workarounds?
  • QLineEdit password safety
  • Why HTML5 Canvas with a larger size stretch a drawn line?
  • Spray.io: When (not) to use non-blocking route handling?
  • Window Size for Mac application
  • Modifying destination and filename of gulp-svg-sprite
  • htaccess rewriting URLs with multiple forward slashes
  • Display Images one by one with next and previous functionality
  • Web-crawler for facebook in python
  • GridView Sorting works once only
  • R: gsub and capture
  • A cron job substitute?
  • Acquiring multiple attributes from .xml file in c#
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • java string with new operator and a literal