| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 392 人关注过本帖
标题:求助 CSS 问题(完整)
取消只看楼主 加入收藏
hgwsywbj
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2012-8-30
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
求助 CSS 问题(完整)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default5.aspx.cs" Inherits="Default5" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.

<html xmlns="http://www.
<head runat="server">
    <title>无标题页</title>
<style type="text/css">
.img
{
    margin:10px 0px 0px -56px; outline:none;
}
.imagebutton
{
    margin:0px 0px 0px -56px;outline:none;
}
#Panel1
{
    padding:0px 0px 0px 80px;
}
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <asp:Panel ID="Panel1" runat="server" Height="120px" BackColor="Azure">
        </asp:Panel>
        </ContentTemplate>
        </asp:UpdatePanel>
        
    </div>
    </form>
</body>
</html>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Default5 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        CreateImage();
        
    }

    protected void CreateImage()
    {
        for (int m = 0; m < 3; m++)
        {
            ImageButton bt = new ImageButton();
            bt.CssClass = "img";
            bt.Width = 71;
            bt.Height = 96;
            bt.ImageUrl = "i/" + m.ToString() + ".jpg";
            bt.Click += new ImageClickEventHandler(bt_Click);
            Panel1.Controls.Add(bt);
        }
    }
    void bt_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton bt = (ImageButton)sender;
        string ss = bt.ImageUrl;
        if (bt.CssClass == "imagebutton")
            bt.CssClass = "img";
        else
            bt.CssClass = "imagebutton";

    }
按钮数为1时运行正常,多个时无效。
搜索更多相关主题的帖子: html css outline PUBLIC server 
2012-11-07 21:17
快速回复:求助 CSS 问题(完整)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.035594 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved