Help - Search - Members - Calendar
Full Version: Additional Space in Html
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
lasantharoshan
Hi Friends,

I have small issue on my html page. When I place two text in html page as follows it displays without any issue.
<label>A</label><label>B</label>

it prints on the page such as "AB", but when I place the above two html labels as follows it adds addition space between two text.
<label>A</label>
<label>B</label>

it prints on the page such as "A B" (notice the space between "A" and "B")

Please let me know how to avoid that space without avoiding use label control

Thanks
Lasantha
pandy
Don't make a line break?
Darin McGrew
Or put the line break inside something else?

<label>A</label><!--
--><label>B</label>

<label>A</label><label
>B</label>
pandy
Maybe we shoud explain som more.

All whitespace is rendered as a single space. Whitespace is basically spaces, tabs and linebreaks. A linebreak in the source code will render the same as a space. Also, if you have several instances of whitespace after each-other, they'll collapse into one space.

CODE
abc def

CODE
abc                    def

CODE
abc


def

All three examples above well render the same:
abc def.

The above is true for text mixed with inline tags. Between block level elements you can have any amount of whitespace. It won't be rendered at all.
lasantharoshan
QUOTE(Darin McGrew @ Jun 4 2009, 03:32 PM) *

Or put the line break inside something else?

<label>A</label><!--
--><label>B</label>

<label>A</label><label
>B</label>



Thanks guys , i was able to fix the issue as follows as you suggested

<label>A</label><!--
--><label>B</label>

Thanks
Lasantha
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.