2014-08-28 83 views
0

我有小項目使用HTML,CSS,C#與剃刀語法。如何在佈局頁面上放置圖像?

我有佈局頁面(sheard文件夾),我使用renderbody()。

在佈局頁面上,我想要在所有頁面上放置一個圖像(「intro.png」)(因爲我將圖像放在佈局頁面上),但是當我在其他頁面放置在我的小網頁不會顯示,只顯示在第一頁上。 這是我的佈局頁的asection:

<!-- Introduction --> 

    <header> 
     <h2>head?</h2> 
    </header> 
    <p>some text.</p> 
    <img src="Content/images/intro.png"> 
</section> 
<div id="content"> 
    @RenderBody() 
    <aside> 
     <section> 
      <header> 
       <h3>Categories</h3> 
      </header> 

     </section> 
     <section> 
      <header> 
       <h3>Archives</h3> 
      </header> 
      <ul> 
       <li><a href="#">December 2008</a></li> 
       <li><a href="#">January 2009</a></li> 
       <li><a href="#">February 2009</a></li> 
       <li><a href="#">March 2009</a></li> 
      </ul> 
     </section> 
    </aside> 
</div> 

回答

0

而不是給鏈接到圖片的方式:

<img src="Content/images/intro.png"> 

使用此:

<img [email protected]("~/Content/images/intro.png")> 

我覺得這是一個問題,圖像路徑..我想上面的回答會解決這個問題..

+0

你好!感謝它的工作正常 – 2014-08-28 05:49:22

+0

@ user3584019 ...你的歡迎.. – 2014-08-28 05:49:42

相關問題