Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trim whitespace in link with css

Tags:

css

Is it possible to trim whitespaces with css? In the code snippet below there is a extra whitespace in the <a> tag. The link comes out of a wordpress plugin and I don't want to edit the plugin source files. The extra space is inside the source files. What I can do is apply css to the link.

click <a href="#" class="foo">here </a>to login.

Worst case scenario I could use JavaScript. But that seems ugly to me.

like image 301
Niek de Gooijer Avatar asked Mar 09 '16 09:03

Niek de Gooijer


1 Answers

You can also do something like this. Altough display: inline-block should be enough to remove the space.

a.foo {
  width : 30px;
  display:inline-block;
}
click <a href="#" class="foo">here </a> to login.
like image 173
Kudos Avatar answered Sep 20 '22 14:09

Kudos