images in a DataList - no dead space

Discussion in 'ASP .Net' started by sklett, Apr 6, 2004.

  1. sklett

    sklett Guest

    I had this working at some point... then something happened.
    I have a DataList that is set to repeat vertically, I have an asp:image in
    each ItemTemplate and the whole thing comes together to work as a navigation
    control. I noticed that I now have the smallest little gap between the
    image and the top of the cells, 1-2 pixels.

    I remember this used to be an issue of having the closing </td> tag on the
    same line as the <img> tag or something like that. I have tried everything
    to get this to work... but, no luck and it is now driving me insane.

    Is there some place where I can read these tricks so that I can practice
    swapping things around to get rid of the gap? Any ideas?

    Here is what the code looks like that is generating the problem:
    <asp:DataList id="dl_nav" runat="server" CellPadding="0">
    <ItemTemplate>
    <asp:HyperLink ID="navLink" Runat="server">
    <asp:Image ID="navImg" Runat="server" />
    </asp:HyperLink>
    </ItemTemplate>
    <SelectedItemTemplate>
    <asp:HyperLink ID="navLink" Runat="server">
    <asp:Image ID="navImg" Runat="server" />
    </asp:HyperLink>
    <div style="padding-left: 30px; background: #ffffff;">
    <asp:DataList ID="navChildren" Runat="server" CellPadding="2"
    OnItemDataBound="navChildren_ItemDataBound">
    <ItemStyle CssClass="navSub" />
    <ItemTemplate>
    <asp:HyperLink ID="navSubLink" Runat="server" CssClass="navLink" />
    </ItemTemplate>
    </asp:DataList>
    </div>
    </SelectedItemTemplate>
    </asp:DataList>



    Any help will be GREATLY appreciated!

    Thanks,
    Steve
     
    sklett, Apr 6, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,941
  2. Shuo Xiang

    Stack space, global space, heap space

    Shuo Xiang, Jul 9, 2003, in forum: C Programming
    Replies:
    10
    Views:
    2,956
    Bryan Bullard
    Jul 11, 2003
  3. Christian Seberino
    Replies:
    21
    Views:
    1,768
    Stephen Horne
    Oct 27, 2003
  4. Ian Bicking
    Replies:
    2
    Views:
    1,081
    Steve Lamb
    Oct 23, 2003
  5. Ian Bicking
    Replies:
    2
    Views:
    765
    Michael Hudson
    Oct 24, 2003
Loading...

Share This Page