niru dyogi
niru dyogi

Reputation: 639

How to suppress space between two HTML elements

I need to supress the space between $ and amount
Now it is showing $ 23 it should show $23

 <span style="color: Red;white-space: nowrap; font-size: 15px">$
                                                <%= Html.Encode(String.Format("{0:F}", item.cy_list_price))%></span>

Upvotes: 1

Views: 85

Answers (1)

Brian Stephens
Brian Stephens

Reputation: 5261

Your markup has a space, so it will render a space. If you don't want it, don't put it there:

<span style="color: Red;white-space: nowrap; font-size: 15px">$<%= Html.Encode(String.Format("{0:F}", item.cy_list_price))%></span>

HTML suppresses extra whitespace, but preserves one space.

Upvotes: 5

Related Questions