I have a line of text that contains multiple span elements. Example:
<div class="line">
<span class="username">mario_sunny: </span><span class="message">Hello would you like to buy a <span class="item">Match</span>?</span>
</div>
The problem is when I try to create this in Java using GWT's InlineLabel or InlineHTML, it trims the leading/trailing spaces within the span, as you can see here:
How do I prevent this?
Here is my code:
HorizontalPanel lineLabel = new HorizontalPanel();
InlineHTML usernameLabel = new InlineHTML();
InlineLabel messageLabel = new InlineLabel();
lineLabel.setStyleName("chat-line");
usernameLabel.setStyleName("chat-username");
usernameLabel.setText("mario_sunny: ");
messageLabel.setText("Hello would you like to buy a Match?");
lineLabel.add(usernameLabel);
lineLabel.add(messageLabel);