tags:

views:

209

answers:

5
+3  Q: 

Imagebuttons gap

+2  A: 

When you split them up in two lines you'll get whitespace between the controls and a whitespace character is rendered. If you place them on the same line with no whitespace between them there is no whitespace rendered.

Don't think there is any other way of doing it.

Sani Huttunen
A: 

you should check the generated HTML to get an idea how's the images are being rendered, I would recommend putting the two asp:imagebuttons inside a div with style='white-space:nowrap'

Kheu
How does specifying nowrap on whitespace cause whitespace to be collapsed?
AnthonyWJones
Anthony's right, this won't help: "nowrap" Sequences of whitespace will collapse into a single whitespace. Text will never wrap to the next line. The text continues on the same line until a <br /> tag is encountered (from http://www.w3schools.com/CSS/pr_text_white-space.asp) - so there will still be one space between the two images.
Zhaph - Ben Duguid
A: 

If you are using VS then

You can format the whole document in the source view.

Go to

Edit -> Advanced -> Format Document

The shortcut is

Ctrl K + Ctrl D

This will remove all the whitespaces and breaks inside your HTMl document.

rahul
This doesn't help
dani
+2  A: 

You could wrap them in an element with a font-size of 0px - that will shrink the space down to a nothing in Firefox, and 1px in IE. It's possibly not ideal, but would work.

Zhaph - Ben Duguid
+1. Simple and effective
AnthonyWJones
I will go with this solution, thanks.
dani
A: 

You could try some CSS along the lines of:

ul#Thumbs li
{
    display: inline;
    list-style: none;
}

And your buttons:

<ul id="Thumbs">
    <li><asp:ImageButton ID="btnVoteUp" Height="16px" Width="16px" runat="server"  ImageUrl="images/thumbs_up.gif" CausesValidation="false" CommandArgument='<%#Eval("ID")%>' CommandName="VoteUp" /></li>
    <li><asp:ImageButton ID="btnVoteDown" Height="16px" Width="16px" runat="server" CausesValidation="false" ImageUrl="images/thumbs_down.gif" CommandArgument='<%#Eval("ID")%>' CommandName="VoteDown" /></li>
</ul>
Mr. Smith
Doesn't work the white-space between the line items has the same effect.
AnthonyWJones