Search code examples
asp.nethtmlhrefwebmatrixasp.net-webpages

Why is my png not displaying on my WebPages site?


I've started my asp.net WebPages site using the "Starter Site" template. It contains a layout page, _SiteLayout.cshtml, that is referenced in Default.cshtml.

In _SiteLayout, there is this HTML:

    <header>
        <div class="content-wrapper">
            <div class="float-left">
                <p class="site-title"><a href="~/Images/something.png"></a></p>
            </div>

It originally had one of the images that "came with" the site instead of "something.png" but since I did not see the original image in the browser when I ran it, I changed it first to ~/Images/orderedList7.png and then to "something.png" in an attempt to raise an err msg or warning. But no! Tolerance, your name is html! (or is it vice-versa?).

At any rate, why am I not seeing the image specified in the layout file when I run the site?


Solution

  • <header>
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title"><img src="~/Images/something.png" /></p>
                </div>
    

    Try that, you are using an anchor instead of an image tag.