![](/img/trans.png)
[英]Background Image wont repeat vertically beyond the ContentPlaceHolder and Child Page
[英]Image in body of Child page ContentPlaceHolder
我有一個包含2個不同子頁面的母版頁面。
如果要在子頁面上放置一個,我想放一個背景圖像。這幾乎起作用,但是該圖像未出現在ContentPlaceHolder中 ,而是出現在主體上。
<%@ Page Title="" Language="C#" MasterPageFile="~/BiPlanning.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<style type="text/css">
body {
background-image:url('tmp.jpg');
<%-- background-size:2px; <-THIS DOES NOT WORK --%>
}
</style>
</asp:Content>
我了解我在做什么錯,但是如何調整圖像大小,使其不覆蓋子頁面的整個主體, 或者如何將actul圖像放入ContentPlaceHolder中 ?
為了使其正常工作,我在我的contantplaceholder中創建了一個DIV標簽並更改了寬度,高度等...
<div width="120" height="100" style="vertical-align:middle; text-align:center" >
<img src="tmp.jpg" />
</div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.