-1

3 つのレイヤーを含む sharepoint の新しいマスター ページを作成しています。最初にphpでページを作成し、Chromeで完全に機能し、最初の行として追加した後、<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">最終的にz-indexをIE8で正しく機能させることができました. ただし、マスター ページにするために必要なコードを追加すると、Chrome または IE8 でレイヤリングが機能しなくなりました。

コード:-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ Master Language="C#" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<html dir="ltr">

<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<SharePoint:RobotsMetaTag runat="server"></SharePoint:RobotsMetaTag>
<title>Untitled 1</title>
<asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
<style>
.gradient{
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3ab87, endColorstr=#7c796a)";
    background: -webkit-gradient(linear, left top, left bottom, from(#b3ab87), to(#7c796a)); 
}
.gradient2{
    background: -webkit-gradient(linear, left top, right top, from(#dded9e), to(#fff), color-stop(0.7, #fff));
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFdded9e, endColorstr=#FFFFFFFF, GradientType=1)";
}
.gradient3{
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#7c796a, endColorstr=#b3ab87)";
    background: -webkit-gradient(linear, left top, left bottom, from(#7c796a), to(#b3ab87)); 
}
a:link{
    color:orange;
}
</style>

</head>

<body bgcolor="#b3ab87" style="font-family:'Arial';margin:0;padding:0">

<form id="form1" runat="server">
<div style="margin:0 auto;width:960px;position:relative">
    <div style="background-image:url('../SiteAssets/headerMainNEW.jpg');width:960px;height:155px;top:0;position:relative;z-index:2">
        <div style="top:40px;left:50px;font-size:2.9em;font-family:'Calibri';color:#938d81;position:relative;z-index:3">
            Site Name
        </div>
        <div style="float:right;width:195px;height:35px;margin-top:-52px;position:relative" class="gradient2">
        </div>
    </div>
    <div style="width:970px;margin-left:-5px;margin-top:-155px;height:155px;z-index:1;position:absolute" class="gradient">
    </div>
    <div style="width:970px;margin-left:-5px;margin-top:-19px;z-index:1;position:relative;overflow:auto" class="gradient3">
        <div style="margin:0 auto;width:960px;position:relative;margin-top:18px;background-color:#777777;z-index:2">

    <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server">
        </asp:ContentPlaceHolder>
</div>
    </div>
    <div style="color:#ffffff;font-size:0.75em;line-height:18px;position:relative">
        <div style="margin:10px">
            <span style="float:left">
                Footer text left
            </span>
            <span style="float:right">
                Footer text right
            </span>
        </div>
    </div>

</div>

</form>

</body>

</html>
4

1 に答える 1

0

失敗したのは z-index ではなく、勾配コードであることが判明しました。今のところ無地の背景色に切り替えたところ、意図したとおりに機能しました。グラデーション コードを機能させることができるかどうかを確認します。それ以外の場合は、代わりにグラデーション イメージを作成する必要があるかもしれません。

于 2012-11-12T18:45:01.063 に答える