zoukankan      html  css  js  c++  java
  • 网站根目录的问题

       今天在做学习挑战杯的项目的时候,侧边的Layout图片始终出不来,晚上看了好久才发现是最基础的根目录的问题,在vs里面操作之前是直接把图片拉出来,这样子图片就可以直接显示了,但是今天不行。很纳闷呀。

    image就是这样的显示不出来。

    代码如下:

                <a target="_blank" title="新浪微博" href="http://weibo.com/5369904897/">
                    <img style=" 20%;max- 36px;" src="~/Content/Web/images/sina.png" alt="新浪微博" />
                </a>
                <a target="_blank" title="腾讯微博" href="http://t.qq.com/huolongji?preview">
                    <img style=" 20%;max- 36px;display: inline-block;" src="~/Content/Web/images/qq.png" alt="腾讯微博" />
                </a>
                <a target="_blank" class="home-renren" title="人人网" href="http://www.renren.com/600991382">
                    <img style=" 20%;max- 36px;display: inline-block;" src="~/Content/Web/images/rr.png" alt="人人网" />
                </a>
                <a style="margin-right: 0;" target="_blank" class="home-linkin" title="LinkedIn" href="http://cn.linkedin.com/pub/bio-discover/38/4b6/a27">
                    <img style=" 20%;max- 36px;display: inline-block;" 
                         src="~/Content/Web/images/in.png" alt="LinkedIn" />
                </a>

    这里是图片路径的问题,这样修改下就可以了

                <a target="_blank" title="新浪微博" href="http://weibo.com/5369904897/">
                    <img style=" 20%;max- 36px;" src="/Content/Web/images/sina.png" alt="新浪微博" />
                </a>

    这就是很明显的网站目录理解有问题。image

    1:可以看下面整个项目的目录结构。

    image

    红色:这个是网站的根目录,也就是相当于我们本地站点http://localhost:2151/这个路径就可以到达这个路径了。

    黑色:一级目录;

    Fonts:二级目录;

    我们一般的/就是向上面返回一层。这样就到了上一层的目录了。

  • 相关阅读:
    第三篇:python函数
    第二篇:数据类型
    第一篇:初识python
    PyTorch教程之Autograd
    PyTorch教程之Tensors
    如何解决Python.h:No such file or directory
    如何解决conda install:command not found问题
    Linux 安装Anaconda 4.4.0
    Linux安装pytorch的具体过程以及其中出现问题的解决办法
    Writing Science 7.10 (The Opening and The Funnel)
  • 原文地址:https://www.cnblogs.com/netxiaohui/p/5289621.html
Copyright © 2011-2022 走看看