Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Friday, March 11, 2016

HTML Character - Invisible space

HTML Character - Invisible space


I have a website called DaltonEmpire.

When a user copies "DaltonEmpire" I would like "Dalton Empire" to be added to their clipboard.

I only came to one solution; use a space, but make the letter-spacing -18px. Isn't there a neater solution, such as a HTML character for this?

My example JSFiddle and code:

  1. DaltonEmpire
  2. Dalton?Empire
  3. Dalton?Empire
  4. Dalton?Empire
  5. Dalton Empire The only one that works

Answer by Bhojendra Nepal for HTML Character - Invisible space


You can also use font-size: 0; demo

span.nospace {          font-size: 0;      }  

Answer by AVAVT for HTML Character - Invisible space


How about this? Looks neat enough to me:

ol li{      word-spacing: -4px; /* just enter an appropriate amount here */  }  

You can now remove the nospace span.

Answer by user3096206 for HTML Character - Invisible space


Are you looking something like this:

HTML space:   ?

Answer by Manoj for HTML Character - Invisible space


you can give margin-left or Font-size CSS property

DEMO

span.nospace {        margin-left: -4px; /* or font-size:0px */  }  

Answer by nkmol for HTML Character - Invisible space


You can use word-spacing for this. However to make a more dynamic property you want to use the em unit. This way the unit is based on the font-size, so actually supports all the font families and font sizes:

ol li  {      word-spacing: -.2em;  }  

em is not an absolute unit - it is a unit that is relative to the currently chosen font size.

source: Why em instead of px?

jsFiddle


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.