<%--程序名称:9-03.aspx--%>
<%--程序功能:引用子母版页的内容页--%>
<%@ Page Language="C#" MasterPageFile="~/SMasterPage.master"
AutoEventWireup="true" CodeFile="9-03.aspx.cs"
Inherits="_9_03" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
我是引用子母版页的内容页
</asp:Content>
<asp:Content ID="xu" ContentPlaceHolderID="Content2" runat="server">
<table width="100px" style="background-color:Transparent; filter:Alpha(opacity=100); position:absolute;" >
<tr>
<td align="center" style="filter:Alpha(opacity=30);" >I am xuhaitian</td>
</tr>
</table>
</asp:Content>
<%--程序名称:FMasterPage.master--%>
<%--程序功能:父母版页--%>
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="FMasterPage.master.cs" Inherits="FMasterPage" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>我是父母版页</h1>
<asp:contentplaceholder id="MainContent" runat="server">
</asp:contentplaceholder>
<h1>我是父母版页</h1>
</div>
</form>
</body>
</html>
<%--程序名称:FMasterPage.master--%>
<%--程序功能:引用父母版页的子母版页--%>
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="SMasterPage.master.cs"
Inherits="SMasterPage" MasterPageFile="~/FMasterPage.master"%>
<asp:Content id="Content1" ContentPlaceholderID="MainContent" runat="server">
<asp:panel runat="server" id="panelMain" backcolor="lightyellow">
<h2>我是子母版页</h2>
<asp:panel runat="server" id="panel1" backcolor="lightblue">
<p>我是子母版页的content部分.</p>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" />
</asp:panel>
<asp:panel runat="server" id="panel2" backcolor="lightblue">
<p>我是子母版页的content部分.</p>
<asp:ContentPlaceHolder ID="Content2" runat="server" />
</asp:panel>
</asp:panel>
</asp:Content>
半透明说明 :
<tr>
<td valign="top" width="620px" style="font-size:12px;font-family:宋体color:#00ff00;height:auto;background-color:#999999;filter:Alpha(opacity=30);border-left:1px solid #ffffff;border-right:1px solid #ffffff;">
<table border="0" cellspacing="0" cellpadding="0" style="filter:Alpha(opacity=100);">
设置table背景色半透明的,不料连里面的文字也半透明了,在网上看看说在table中加上filter:Alpha(opacity=100),就可以让内容不为透明请问如何解决?
你可以把里边table的position设为absolute,这样就不会出现这种情况了。不过这个时候需要明确指定一下父table的height。