当网页基于母版页时,是否可以在网页上设置背景图片。请注意,我要更改的不是母版页的背景,而是使用母版页的页面的背景。
最佳答案
您可以只为 body{} 或实际 ASPX 页面上的任何内容添加样式规则。它将覆盖在母版页级别设置的任何样式。
编辑:示例:
<%@ Page Title="Example" Language="C#" MasterPageFile="~/MasterPages/Main.master"
AutoEventWireup="true" CodeBehind="TroubleShootScanning.aspx.cs"
Inherits="SpectrumTechnologies.TroubleShootingScanning" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" runat="server">
<style type='text/css'>
body { background-image: url(images/bgimage.jpg); }
</style>
<!-- the rest of the page here -->
</asp:Content>
这将覆盖样式表中设置的任何值。
关于c# - 使用主页时在网页上设置背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1343143/