|
이 문서는 기계로 번역한 것입니다. 원본 텍스트를 보려면 포인터를 문서의 문장 위로 올리십시오. 추가 정보
|
번역
원본
|
WebControl.CssClass 속성
네임스페이스: System.Web.UI.WebControls
어셈블리: System.Web(System.Web.dll)
보안 정보 |
|---|
<asp:TextBox id="TextBox1" ForeColor="Red" CssClass="class1" />
<input type=text class="class1" style="ForeColor:red">
참고 |
|---|
| Topic | Location |
|---|---|
| 방법: 외부 CSS 스타일시트 만들기(Visual Studio) | Building ASP .NET Web Applications in Visual Studio |
참고 |
|---|
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> void Button1_Click(object sender, EventArgs e) { if (HyperLink1.CssClass == "CssStyle1") HyperLink1.CssClass = "CssStyle2"; else HyperLink1.CssClass = "CssStyle1"; } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head2" runat="server"> <title>CssClass Property Example</title> <style type="text/css"> .CssStyle1 { font: 10pt Verdana; font-weight:700; color: Green; } .CssStyle2 { font: 15pt Times; font-weight:250; color: Blue; } </style> </head> <body> <form id="form1" runat="server"> <div> <h3>CssClass Property of a Web Control</h3> <asp:HyperLink id="HyperLink1" NavigateUrl="http://www.microsoft.com" CssClass="CssClass1" Text="Click here to go to the Microsoft site" Target="_new" runat="server" /> <p><asp:Button id="Button1" Text="Click to change the CSS style of the link" OnClick="Button1_Click" runat="server" /> </p> </div> </form> </body> </html>
<html>
<head>
<style>
.CssStyle1
{
font: 12pt verdana;
font-weight:700;
color:orange;
}
.CssStyle2
{
font: 15pt times;
font-weight:250;
color:blue;
}
</style>
<script language="C#" runat="server">
void Button1_Click(Object sender, EventArgs e) {
HyperLink1.CssClass=((HyperLink1.CssClass=="CssStyle1")?"CssStyle2":"CssStyle1");
}
</script>
</head>
<body>
<h3><font face="Verdana">CssClass Property of a Web Control</font></h3>
<form runat="server">
<asp:HyperLink id="HyperLink1" NavigateUrl="http://www.microsoft.com"
CssClass="spanstyle" Text="Click here to go to the Microsoft site"
Target="_new" runat="server"/>
<p>
<asp:Button id="Button1" Text="Click to change the Css style of the above link"
OnClick="Button1_Click" runat="server"/>
</form>
</body>
</html>
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008(서버 코어 역할은 지원되지 않음), Windows Server 2008 R2(서버 코어 역할은 SP1 이상에서 지원, Itanium은 지원되지 않음)
.NET Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
보안 정보