Set a background image on a webpage when using the homepage
4 answers
You can just add a style rule for the {} body or whatever in a real ASPX page. It will override any style set at the master page level.
edit: example:
<%@ 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>
This will override any values โโset in the style sheet.
+4
source to share
I suggest adding the tag <asp:ContentPlaceHolder ID="ExtraStyles" runat="server" />
to your homepage header. This way you can add the following to your page:
<asp:Content ID="ExtraStylesContent" ContentPLaceHolderId="ExtraStyles" runat="server">
<style type="text/css">
body {background-image:url('someotherimage.jpg');
</style>
</asp:Content>
By adding an extra ContentPlaceHolder you won't get scattered style tags, they will end up in the main tag of the rendered html.
+2
source to share