Hi
Ich habe mal wieder mal ein Problem.
Ich habe eine Masterpage erstellt.
Dort habe ich einige Tabellen die ein Bildhintergrund haben.
[php]background-image: url('images/masterpage/0_0_Head.png');"[/php]
ich habe im hauptverzeichnis von der Website die Ordner namens Images/masterpage angelegt.
Nun habe ich eine Contentpage in einen Ordner sites/other erstellt. Leider findet
die Contentpage die Bilder nicht weil Sie wahrscheinlich die Bilder folgendermassen sucht.
[php]background-image: url('sites/other/images/masterpage/0_0_Head.png');"[/php].
Wie kann ich das Problem beheben ?
Hallo Ayke
Entweder gehen die Bilder oder aber nicht.
Die ContentPages und Masterpages werden zu der einen Seite zusammengesetzt, nur der resultierende Pfad aus dieser Seite zählt.,
Ich würde die Bilder einen Ordner unter dem Root, bspw. /images/ speichern.
Die Zuweisung im CSS geschieht dann relativ.
Gruss Peter
--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011
leider funktioniert das trozdem nicht.
die bilder werden nicht gefunden wenn die contentpage in einen andren verzichnis ist.
so sieht mein css für die Tabellen Hintergrundbilder aus
[php] <td style="height: 61px; width: 152px; background-image: url('images/masterpage/LeftBarCountry11_0.png');"> </td>[/php]
Hallo Ayke
Ich benutze den Designer fast gar nicht.
Es kann sein, das die Bilder im Designer nicht angezeigt werden, auf der laufenden Webseite dann schon.
Die Hochkomas solltest du weglassen, die gehören nicht hin:
background-image: url(images/masterpage/LeftBarCountry11_0.png);
Gruss Peter
--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011
Der Designer spackt scho ein wenig mit den Bildern rum. Das ist wohl war.
Stimmen denn die relativen Pfade? Diese müssen relativ von der css File aus sein. Mal testweise gegen absolute Pfade getauscht?
@ Peter Bucher leider werden die bilder auch nicht in browser gezeigt.
@ die pfade sind relativ aber ich habe die bilder nicht in einen externen .css datei zugewiesen sondern direkt in der masterpage.
vill hilft der src von der contentpage :
[php]<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="empty.aspx.cs" Inherits="Default2" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
[/php]
@ Peter Bucher leider werden die bilder auch nicht in browser gezeigt.
@ die pfade sind relativ aber ich habe die bilder nicht in einen externen .css datei zugewiesen sondern direkt in der masterpage.
src von der contentpage :
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="empty.aspx.cs" Inherits="Default2" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
die masterpage :
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Noname</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body style="background-color: Black; margin-bottom: 0; ">
<form id="form1" runat="server">
<div>
<table style="width: 1224px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table style="width: 940px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="height: 235px; width: 568px; background-image: url('images/masterpage/0_0_Head.png');"> </td>
<td style="height: 235px; width: 41px; background-image: url('images/masterpage/0_1_Frame.png');"> </td>
<td style="height: 235px; width: 289px; background-image: url('images/masterpage/0_2_DynamicPicture.png');"> </td>
<td style="height: 235px; width: 42px; background-image: url('images/masterpage/0_3_Frame.png');"> </td>
</tr>
</table>
</td>
<td style="width: 30px; " rowspan="3"> </td>
<td style="width: 254px; " rowspan="3"><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</td>
</tr>
<tr>
<td>
<table style="width: 940px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table style="width: 306%;" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="height: 19px; width: 607px; background-image: url('images/masterpage/1_0_UnderHeadFrame.png');"> </td>
</tr>
<tr>
<td>
<table style="width: 607px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="height: 33px; width: 8px; background-image: url('images/masterpage/2_0_Frame.png');"> </td>
<td style="height: 33px; width: 82px; background-image: url('images/masterpage/2_1_ButtonHome.png');"> </td>
<td style="height: 33px; width: 99px; background-image: url('images/masterpage/2_2_ButtonDownload.png');"> </td>
<td style="height: 33px; width: 82px; background-image: url('images/masterpage/2_3_ButtonAbout.png');"> </td>
<td style="height: 33px; width: 88px; background-image: url('images/masterpage/2_4_ButtonSupport.png');"> </td>
<td style="height: 33px; width: 74px; background-image: url('images/masterpage/2_5_ButtonInfo.png');"> </td>
<td style="height: 33px; width: 174px; background-image: url('images/masterpage/2_6_Frame.png');"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<table style="width: 333px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_0_CSS.png');"> </td>
<td style="height: 52px; width: 10px; background-image: url('images/masterpage/3_1_Frame.png');"> </td>
<td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_2_Fifa.png');"> </td>
<td style="height: 52px; width: 10px; background-image: url('images/masterpage/3_3_Frame.png');"> </td>
<td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_4_UT.png');"> </td>
<td style="height: 52px; width: 13px; background-image: url('images/masterpage/3_5_Frame.png');"> </td>
<td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_6_Battlefield.png');"> </td>
<td style="height: 52px; width: 11px; background-image: url('images/masterpage/3_7_Frame.png');"> </td>
<td style="height: 52px; width: 48px; background-image: url('images/masterpage/3_8_C&C3.png');"> </td>
<td style="height: 52px; width: 49px; background-image: url('images/masterpage/3_9_EndFrame.png');"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 940px; text-align: left;" ; border="0" cellpadding="0" cellspacing="0">
<tr align="left" valign="top">
<td style="background-image: url('images/masterpage/LeftBarCountryBuffer11_0.png');">
<table style="width: 152px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="height: 47px; width: 152px; background-image: url('images/masterpage/LeftBar4_0.png');"> </td>
</tr>
<tr>
<td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_1Tournament.png');"> </td>
</tr>
<tr>
<td style="width: 152px;"></td>
</tr>
<tr>
<td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_4.png');"> </td>
</tr>
<tr>
<td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_5_Gaming.png');"> </td>
</tr>
<tr>
<td style="width: 152px;"> </td>
</tr>
<tr>
<td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_6.png');"> </td>
</tr>
<tr>
<td style="height: 31px; width: 152px; background-image: url('images/masterpage/LeftBar4_7_Infomation.png');"> </td>
</tr>
<tr>
<td style="width: 152px;"> </td>
</tr>
<tr>
<td style="height: 65px; width: 152px; background-image: url('images/masterpage/LeftBar4_8.png');"> </td>
</tr>
<tr>
<td>
<table style="width: 152px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="height: 30px; width: 12px; background-image: url('images/masterpage/LeftBarCountry5_0.png');"> </td>
<td style="height: 30px; width: 127px; background-image: url('images/masterpage/LeftBarCountry5_1.png');"> </td>
<td style="height: 30px; width: 14px; background-image: url('images/masterpage/LeftBarCountry5_2.png');"> </td>
</tr>
<tr>
<td style="height: 95px; width: 12px; background-image: url('images/masterpage/LeftBarCountry6_0.png');"> </td>
<td style="height: 95px; width: 127px; background-image: url('images/masterpage/LeftBarCountry6_1.png');"> </td>
<td style="height: 95px; width: 14px; background-image: url('images/masterpage/LeftBarCountry6_2.png');"> </td>
</tr>
<tr>
<td style="height: 29px; width: 12px; background-image: url('images/masterpage/LeftBarCountry7_0.png');"> </td>
<td style="height: 29px; width: 127px; background-image: url('images/masterpage/LeftBarCountry7_1.png');"> </td>
<td style="height: 29px; width: 14px; background-image: url('images/masterpage/LeftBarCountry7_2.png');"> </td>
</tr>
<tr>
<td style="height: 29px; width: 12px; background-image: url('images/masterpage/LeftBarCountry8_0.png');"> </td>
<td style="height: 29px; width: 127px; background-image: url('images/masterpage/LeftBarCountry8_1.png');"> </td>
<td style="height: 29px; width: 14px; background-image: url('images/masterpage/LeftBarCountry8_2.png');"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="height: 47px; width: 152px; background-image: url('images/masterpage/LeftBarCountry10_0.png');"> </td>
</tr>
</table>
</td>
<td style="width: 788px; ">
<table style="width: 788px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="height: 26px; width: 29px; background-image: url('images/masterpage/content0_0.png');"> </td>
<td style="height: 26px; width: 687px; background-image: url('images/masterpage/content0_1.png');"> </td>
<td style="height: 26px; width: 72px; background-image: url('images/masterpage/content0_2.png');"> </td>
</tr>
<tr>
<td style="width: 29px; background-image: url('images/masterpage/content1_0.png');"> </td>
<td style="height: 576px; width: 687px; background-color: #2D2D2D; vertical-align: top; text-align: left;">
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder></td>
<td style="width: 72px; background-image: url('images/masterpage/content1_1.png');"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 940px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table style="width: 940px; " border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="height: 61px; width: 152px; background-image: url('images/masterpage/LeftBarCountry11_0.png');"> </td>
<td style="height: 21px; width: 29px; background-image: url('images/masterpage/content2_0.png');"> </td>
<td style="height: 61px; width: 687px; background-image: url('images/masterpage/content2_1.png');"> </td>
<td style="height: 61px; width: 72px; background-image: url('images/masterpage/content2_2.png');"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="height: 87px; width: 940px; background-image: url('images/masterpage/footerabs.png');"> </td>
</tr>
</table>
</td>
<td style="width: 30px; "> </td>
<td style="width: 254px; "> </td>
</tr>
</table>
</div>
</form>
</body>
</html>