2013-04-09 48 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