2011-04-10 4 views
1

localhost에서 실행하면 문제가 발생합니다. 일부 코드가 변경 될 때가 있습니다. #header 디자인보기에 나타나지만 localhost 그것은 큰 이미지로 나타나고 내가 말하는 정확한 높이와 너비를 따르지 않습니다. 여기에 붙여 넣을 코드는 디자인보기와 로컬 호스트에 표시되지 않는 코드입니다.div의 특정 이미지가 ASP.net/IIS를 사용하여 localhost에 표시되지 않음

여기 내 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 id="Head1" runat="server"> 
    <title>Untitled Page</title> 
    <link href="App_Themes/default/default.css" rel="stylesheet" type="text/css" runat="server" /> 
    <asp:ContentPlaceHolder id="head" runat="server"> 
    </asp:ContentPlaceHolder> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
    <!--start of css div--> 
    <div id="outer"> 

    <div id="upbg"></div> 

    <div id="inner"> 

     <div id="header" runat="server"> 

     </div> 

     <!--<div id="splash"></div>--> 

     <div id="menu"> 
      <ul> 
       <li class="first"><a href="Default.aspx">Home</a></li> 
       <li><a href="#">Gallery</a></li> 
       <li><a href="#">Links</a></li> 
       <li><a href="About.aspx">About</a></li> 
       <li><a href="Contact.aspx">Contact</a></li> 
      </ul> 

     <div id="Login"><asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"> 
        <AnonymousTemplate> 
         [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ] 
        </AnonymousTemplate> 
        <LoggedInTemplate> 
         Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>! 
         [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ] 
        </LoggedInTemplate> 
       </asp:LoginView> </div> 
     </div> 

<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"> 

     </asp:ContentPlaceHolder> 
     <asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server"> 

     </asp:ContentPlaceHolder> 


     <div id="footer"> 

      &copy;Copyright © 2011 My Personal Werbsite. design by Migs Yandoc. 

     </div> 

    </div> 

</div> 


<!--end of css div--> 


    </div> 
    </form> 
</body> 
</html> 

그리고 여기 내 CSS 코드 :

* 
{ 
padding: 0px; 
margin: 0px; 
    text-align: left; 
} 

body 
{ 
background: #F9F9F7 url('images/a1.gif') repeat-x; 
font-size: 11px; 
font-family: "trebuchet ms", helvetica, sans-serif; 
color: #8C8C73; 
line-height: 18px; 
} 

a 
{ 
color: #FF7800; 
text-decoration: underline; 
} 

a:hover 
{ 
text-decoration: none; 
} 

sup 
{ 
font-size: 0.5em; 
} 


p 
{ 
margin-bottom: 14px; 
text-align: justify; 
} 

img.picA 
{ 
position: relative; 
top: -2px; 
background: url('images/a47.gif') no-repeat; 
width: 76px; 
height: 74px; 
padding: 8px; 
} 

img.picB 
{ 
position: relative; 
top: -2px; 
background: url('images/a26.gif') no-repeat; 
width: 146px; 
height: 75px; 
padding: 7px; 
} 

img.floatleft 
{ 
float: left; 
margin: 0px 14px 3px 0px; 
} 


ul.linklist 
{ 
list-style: none; 
} 

ul.linklist li 
{ 
border-top: solid 1px #EEEEEE; 
padding-top: 5px; 
margin: 5px 0px 0px 0px; 
} 

ul.linklist li.first 
{ 
border-top: 0px; 
margin-top: 0px; 
padding-top: 0px; 
} 

#upbg 
{ 
position: absolute; 
top: 0px; 
left: 0px; 
background: #fff url('images/upbg.gif') no-repeat; 
width: 747px; 
height: 264px; 
z-index: 1; 
} 

#outer 
{ 
position: relative; 
width: 747px; 
margin: 0 auto; 
background: #fff url('images/abg.gif') repeat-y; 
} 

#inner 
{ 
position: relative; 
padding: 13px 30px 13px 30px; 
z-index: 2; 
} 

> #header { 
>  background: url ("~/images/a99.gif") no-repeat; 
>  position: absolute; 
>  width: 202px; 
>  height: 92px; 
>  color: #fff; 
>  padding-left: 20px; 
>  top: 14px; 
>  left: 32px; 
>  visibility: visible; } 



#header span 
{ 
font-weight: normal; 
} 

#header h1 
{ 
position: absolute; 
font-size: 23px; 
letter-spacing: -1px; 
top: 30px; 
height: 92px; 
} 

#header h2 
{ 
position: absolute; 
font-size: 10px; 
font-weight: normal; 
color: #FCE2CA; 
top: 51px; 
} 

#header sup 
{ 
color: #FCE2CA; 
} 

이 이미지는 a99.gif입니다! 크기는 202x92 픽셀입니다.

내가이 부분에 정말로 걸림돌이되게 도와 줄 수 있기를 바랍니다.

미리 감사드립니다.

는 공손히 당신은 MIGS는

~

답변

1

올바른 디렉토리를 제공하기 위해 컴파일되지 않습니다.

background: url ("~/images/a99.gif") no-repeat; 

background: url ("images/a99.gif") no-repeat; 

로 변경을하고 작업 당신은 루트 디렉토리의 페이지가 아닌 하위 디렉토리에있는 경우.

css 파일은 정적 파일이므로 asp.net에 의해 변경되거나 컴파일되지 않습니다.

+0

놀라워요! 당신이 옳습니다. 제 이미지를 어디에 위치 시킬지 문제가 있습니다! from app_themes/default/images app_themes/default는 web.config 파일에서 선언 한 이후로 변경됩니다. 고맙습니다. 엄지 위로! –

관련 문제