<div class="special">
                <asp:DataList ID="dl_zj" runat="server">
                    <ItemTemplate>
                        <table style="width: 343px; height: 130px">
                            <tr>
                                <td style="width: 100px; height: 100px" rowspan="4" align="center">
                                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# "~/SpecialPic/"+Eval("SpecialPic") %>' /></td>
                                <td style="width: 48px; height: 16px" align="right">
                                    <asp:Label ID="Label1" runat="server" Font-Names="宋体" Text="专辑:" Width="66px" Font-Size="X-Small"></asp:Label></td>
                                <td style="width: 11px; height: 16px">
                                    <asp:Label ID="Label2" runat="server" Font-Names="宋体" ForeColor="Red" Text='<%# Eval("SpecialName") %>'
                                        Width="117px" Font-Size="X-Small"></asp:Label></td>
                            </tr>
                            <tr>
                                <td style="width: 48px; height: 16px;" align="right">
                                    <asp:Label ID="Label3" runat="server" Text="歌手:" Width="67px" Font-Size="X-Small"></asp:Label></td>
                                <td style="width: 11px; height: 16px;">
                                    <asp:Label ID="Label4" runat="server" Text='<%# Eval("Singer") %>' Width="114px"
                                        Font-Size="X-Small"></asp:Label></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="width: 300px; height: 31px;" align="left">
                                    <asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Eval("Explain") %>' Width="200px"
                                        Style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap" Font-Size="X-Small"></asp:LinkButton></td>
                            </tr>
                            <tr>
                                <td style="width: 48px; height: 29px;">
                                    <asp:Button ID="Button1" runat="server" Text="Button" /></td>
                                <td style="width: 11px; height: 29px;">
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:DataList>
            </div>上面这段代码,我想设置第七行的<asp:Image ID="Image1"....
这个图片的边框,但是老是,无法实现,css代码我是这样写的,.special #dl_zj ItemTemplate table tr td#Image1
{
    border: 5px solid #00B5F7;
}请问是什么问题,能不能写个代码给我,

解决方案 »

  1.   

    td#Image1?asp.net控件的ID跟html的元素id没有直接的关系。写成class吧,不要使用id。
      

  2.   

    #Image1{
        border: solid 5px #00B5F7;
    }主要问题我估计你样式的顺序错了~border:形状 宽度 颜色
      

  3.   

    样式的顺序没错的,
    #Image1{ 
        border: 5px solid #00B5F7; 
    }
    这样也确实可以,但是,我在其他地方也有ID="Image1"
    的标签,所以要区别于其他,所以要加上前面的东西,
      

  4.   

    好像也是不行的,我刚才调试了下,不行我把那个第七行<asp:Image ID="Image1" runat="server" ImageUrl='<%# "~/SpecialPic/"+Eval("SpecialPic") %>' /></td>
    改成
    <asp:Image ID="Image1" runat="server" ImageUrl='<%# "~/SpecialPic/"+Eval("SpecialPic") %> ' Style="border: 13px solid #E6E6E6;"/></td>
    就可以了,但是为什么
    #Image1{ 
        border: 13px solid #E6E6E6;

    就不行呢
      

  5.   

    不要又用类,又用名称的,直接就用class方式来写就行