2013-04-09 49 views
0

图像没有出现在我的本地主机上。这里是HTML代码。我试过几种变化来显示te图像。使用Twitter Bootstrap。任何帮助将不胜感激。图像没有出现在本地主机上

<div class="media"> 
    <a class="pull-left" href=""> 
    <img class="media-object" src="/img/grads.jpg/64x64"> 
    </a> 
    <div class="media-body"> 
    <h4 class="media-heading">Collaborate with students at other Universities</h4> 
    <p>Join your classes and work with other students on studying without having to meet up.</p> 
    </div> 
    </div> 

    <div class="media"> 
    <a class="pull-left" href=""> 
    <img class="media-object" src="grads.jpeg/64x64"> 
    </a> 
    <div class="media-body"> 
    <h4 class="media-heading">Meet new friends you're in class with</h4> 
    <p>Pick who you want to be a stranger in your own classes. School is social and so is moreo. :)</p> 
    </div> 
    </div> 

这里是CSS代码。不知道我做错了什么。

<link href="../assets/css/bootstrap.css" rel="stylesheet"> 
<style type="text/css"> 
    body { 
    padding-top: 10px; 
    padding-bottom: 20px; 
    } 

    /* Custom container */ 
    .container-narrow { 
    margin: 0 auto; 
    max-width: 700px; 
    } 
    .container-narrow > hr { 
    margin: 30px 0; 
    } 

    /* Main marketing message and sign up button */ 
    .jumbotron { 
    margin: 30px 0; 
    text-align: center; 
    } 
    .jumbotron h1 { 
    font-size: 72px; 
    line-height: 1; 
    } 
    .jumbotron .btn { 
    font-size: 15px; 
    padding: 10px 20px; 
    } 

    /* Supporting marketing content */ 
    .marketing { 
    margin: 5px 0; 
    } 
    .marketing p + h4 { 
    margin-top: 14px; 
    } 
</style> 
<link href="../assets/css/bootstrap-responsive.css" rel="stylesheet"> 
+0

您能够通过IP查看映像?什么是图像路径末尾的/ 64x64? – muneebShabbir 2013-04-09 05:37:37

+0

如果您使用的是Chrome或Firebug,您是否看到为图像文件发送的HTTP请求,如果有,是否返回? – Anthony 2013-04-09 05:40:02

+0

另外,当你说本地主机,你的意思是一个本地的LAMP堆栈,或者你的意思是只有html的文件://方案?即使使用上述代码 – Anthony 2013-04-09 05:41:38

回答

1

尝试查看源代码并检查图像的路径。由于您使用了相对路径,请检查是否在本地拍摄图像的正确路径

0

验证您的图像路径。它应该以文件名及其正确的扩展名结尾。

见你,

<img class="media-object" src="grads.jpeg/64x64"> 

这可能是这样的,我想;

<img class="media-object" src="/64x64/grads.jpeg"> 

现在,如果图像(grads.jpeg)是根的64×64文件夹中,这肯定会呈现。

0

使用Bootstrap image图像加载和媒体对象使用data-src属性不src,但我没有看到直接图像URL加载图像的任何例子Bootstrap Media object

编辑

我认为这个标签是指在线网址, 我不确定。看看这个placehold这个URL是实用站点,它重新调整托管映像的大小,就像引导示例

+0

Heading

This is the text you can place next to the image.

buttonitup 2013-04-09 14:05:57

+0

,图像不填充。 img文件夹位于我的目录中,其中包含所有图像。我已经尝试了几十次迭代。 – buttonitup 2013-04-09 14:07:32

+0

我编辑了我的答案 – muneebShabbir 2013-04-10 03:55:25