2016-07-27 48 views
1

我正在使用我在互聯網上找到的自定義主題進行引導。當我添加一個新的「行」爲我的網格系統事情有點搞砸了, 我不知道我在做什麼錯,但我相信是造型問題,因爲它似乎沒有告訴我我想要它做什麼表明所以當我加載網頁,我看到下面爲什麼bootstrap不顯示我的一些元素?

,如果你需要進一步的信息,以便能夠幫助我,我很樂意給它 Pic example 1

和瀏覽器上的滾動條(允許你滾動下)

通過這樣做一秒鐘,你可以看到還有什麼應該像那樣

pic example 2

但它的缺陷,我會分享我的代碼,如果任何人都可以幫助我,我不是一個exprienced檢測員,但我想到那裏。 這裏是viewHero.php

<?php session_start(); 
//error_reporting(0); 
//ini_set('display_errors', 0); 
?> 
<!doctype html> 
<html lang="en" > 
<head> 
    <meta charset="UTF-8"> 
    <meta name="viewport" > 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">  



    <link rel="stylesheet" href="style/reset.css"> <!-- CSS reset --> 
    <link rel="stylesheet" href="style/style.css"> <!-- Resource style --> 
    <script src="js/modernizr.js"></script> <!-- Modernizr --> 

    <title>Overblog</title> 
</head> 
<body > 
    <header class="cd-main-header"> 
     <a href="#0" class="cd-logo"><img src="img/cd-logo.svg" alt="Logo"></a> 

     <div class="cd-search is-hidden"> 
      <form action="#0"> 
       <input type="search" placeholder="Search..."> 
      </form> 
     </div> <!-- cd-search --> 

     <a href="#0" class="cd-nav-trigger">Menu<span></span></a> 

     <nav class="cd-nav"> 
      <ul class="cd-top-nav"> 

       <li class="has-children account"> 

        <ul> 


        </ul> 
       </li> 
      </ul> 
     </nav> 
    </header> <!-- .cd-main-header --> 

    <main class="cd-main-content"> 
     <nav class="cd-side-nav"> 
      <ul> 
       <li class="cd-label">Main</li> 
       <li class="has-children overview"> 
        <a href="#0">Blog</a> 

        <ul> 
         <li><a href="#0">Latest news</a></li> 
         <li><a href="#0">Public Test Region</a></li> 
         <li><a href="#0">RedPost (Redit)</a></li> 
        </ul> 
       </li> 
       <li class="has-children notifications active"> 


       <li class="has-children comments"> 
        <a href="#0">Guides</a> 

       </li> 

       <li class="has-children users"> 
        <a href="#0">Hereos</a> 

       </li> 

      </ul> 

     </nav> 

    <style> 

body 
{ 
    font-family: 'Open Sans', sans-serif; 
} 

.fb-profile img.fb-image-lg{ 
    z-index: 0; 
    width: 100%; 
    margin-bottom: 10px; 
} 

.fb-image-profile 
{ 
    margin: -90px 10px 0px 50px; 
    z-index: 9; 
    width: 20%; 
} 

@media (max-width:768px) 
{ 

.fb-profile-text>h1{ 
    font-weight: 700; 
    font-size:16px; 
} 

.fb-image-profile 
{ 
    margin: -45px 10px 0px 25px; 
    z-index: 9; 
    width: 20%; 
} 
} 
h2{font-size:40px; 
     } 
     </style>  
    <div class="content-wrapper"> 
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> 
<div class="container"> 
    <div class="row">     
    <?php 
//show users code. 
      define('SITE_ROOT', dirname(__FILE__)); 
echo "<br/>"; 
       require SITE_ROOT . '\includes\loadHeroProfile.php'; 
    ?> 
    </div> 
<div class="row"> 
     <div class='col-lg-4'> 
<ul class="list-group"> 
    <li class="list-group-item">Cras justo odio</li> 
    <li class="list-group-item">Dapibus ac facilisis in</li> 
    <li class="list-group-item">Morbi leo risus</li> 
    <li class="list-group-item">Porta ac consectetur ac</li> 
    <li class="list-group-item">Vestibulum at eros</li> 
</ul> 
    </div> 

    </div> 
</div> <!-- /container --> 

     </div> 

    </main> <!-- .cd-main-content --> 
<script src="scripts/jquery-2.1.4.js"></script> 
<script src="scripts/jquery.menu-aim.js"></script> 
<script src="scripts/main.js"></script> <!-- Resource jQuery --> 
</body> 
</html> 

的代碼,這裏是loadHeroProfile.php

<?php 
//show users code. 


require SITE_ROOT . '\includes\db_connect.php'; 
//create connection and check it 
global $connect; 
$ids = intval($_GET['ids']); 

$result = $conn->prepare("SELECT id,nickname,avatar,name,age,occupation,operations,affiliation,difficulty,ability,tips,story FROM heroes WHERE id=$ids"); 
$result->execute(); 
while ($row = $result->fetch(PDO::FETCH_ASSOC)) { 
    $id = $row["id"]; 
    $nickname = $row["nickname"]; 
    $avatar = $row["avatar"]; 
    $name = $row["name"]; 
    $age = $row["age"]; 
    $occ = $row["occupation"]; 
    $opp = $row["operations"]; 
    $aff = $row["affiliation"]; 
    $diff = $row["difficulty"]; 
    $ability = $row["ability"]; 
    $tips = $row["tips"]; 
    $story = $row["story"]; 

    $avatar = "./img/" . $avatar; 
    echo " <div class='fb-profile'> "; 
    echo " <img align='left' class='fb-image-lg' src='./img/Untitled.png' alt='Profile image example'/> "; 
    echo " <img align='left' class='fb-image-profile thumbnail' src=". $avatar ." alt='Profile image example' /> "; 
    echo "  <div class='fb-profile-text'> "; 
    echo "   <h2>" . $nickname . "</h2><br/> "; 
    echo "   <p>" . $name . "</p> "; 
    echo "  </div> "; 
    echo " </div> "; 

    } 
?> 

我能做些什麼來解決這個問題? 修改最終HTML代碼:

<!doctype html> 
<html lang="en" > 
<head> 
    <meta charset="UTF-8"> 
    <meta name="viewport" > 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">  



    <link rel="stylesheet" href="style/reset.css"> <!-- CSS reset --> 
    <link rel="stylesheet" href="style/style.css"> <!-- Resource style --> 
    <script src="js/modernizr.js"></script> <!-- Modernizr --> 

    <title>Overblog</title> 
</head> 
<body > 
    <header class="cd-main-header"> 
     <a href="#0" class="cd-logo"><img src="img/cd-logo.svg" alt="Logo"></a> 

     <div class="cd-search is-hidden"> 
      <form action="#0"> 
       <input type="search" placeholder="Search..."> 
      </form> 
     </div> <!-- cd-search --> 

     <a href="#0" class="cd-nav-trigger">Menu<span></span></a> 

     <nav class="cd-nav"> 
      <ul class="cd-top-nav"> 

       <li class="has-children account"> 

        <ul> 


        </ul> 
       </li> 
      </ul> 
     </nav> 
    </header> <!-- .cd-main-header --> 

    <main class="cd-main-content"> 
     <nav class="cd-side-nav"> 
      <ul> 
       <li class="cd-label">Main</li> 
       <li class="has-children overview"> 
        <a href="#0">Blog</a> 

        <ul> 
         <li><a href="#0">Latest news</a></li> 
         <li><a href="#0">Public Test Region</a></li> 
         <li><a href="#0">RedPost (Redit)</a></li> 
        </ul> 
       </li> 
       <li class="has-children notifications active"> 


       <li class="has-children comments"> 
        <a href="#0">Guides</a> 

       </li> 

       <li class="has-children users"> 
        <a href="#0">Hereos</a> 

       </li> 

      </ul> 

     </nav> 

    <style> 

body 
{ 
    font-family: 'Open Sans', sans-serif; 
} 

.fb-profile img.fb-image-lg{ 
    z-index: 0; 
    width: 100%; 
    margin-bottom: 10px; 
} 

.fb-image-profile 
{ 
    margin: -90px 10px 0px 50px; 
    z-index: 9; 
    width: 20%; 
} 

@media (max-width:768px) 
{ 

.fb-profile-text>h1{ 
    font-weight: 700; 
    font-size:16px; 
} 

.fb-image-profile 
{ 
    margin: -45px 10px 0px 25px; 
    z-index: 9; 
    width: 20%; 
} 
} 
h2{font-size:40px; 
     } 
     </style>  
    <div class="content-wrapper"> 
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> 
<div class="container"> 
    <div class="row">     
    <br/> <div class='fb-profile'>  <img align='left' class='fb-image-lg' src='./img/Untitled.png' alt='Profile image example'/>  <img align='left' class='fb-image-profile thumbnail' src=./img/bastion.png alt='Profile image example' />   <div class='fb-profile-text'>    <h2>Bastion</h2><br/>    <p>SST Laboratories Siege Automaton E54, "Bastion"</p>   </div> </div>  </div> 
<div class="row"> 
     <div class='col-lg-4'> 
<ul class="list-group"> 
    <li class="list-group-item">Cras justo odio</li> 
    <li class="list-group-item">Dapibus ac facilisis in</li> 
    <li class="list-group-item">Morbi leo risus</li> 
    <li class="list-group-item">Porta ac consectetur ac</li> 
    <li class="list-group-item">Vestibulum at eros</li> 
</ul> 
    </div> 

    </div> 
</div> <!-- /container --> 

     </div> 

    </main> <!-- .cd-main-content --> 
<script src="scripts/jquery-2.1.4.js"></script> 
<script src="scripts/jquery.menu-aim.js"></script> 
<script src="scripts/main.js"></script> <!-- Resource jQuery --> 
</body> 
</html> 

編輯的要求造型: 注意,我並沒有提出或觸及這一點,是在互聯網上 reset.css

/* http://meyerweb.com/eric/tools/css/reset/ 
    v2.0 | 20110126 
    License: none (public domain) 
*/ 

html, body, div, span, applet, object, iframe, 
h1, h2, h3, h4, h5, h6, p, blockquote, pre, 
a, abbr, acronym, address, big, cite, code, 
del, dfn, em, img, ins, kbd, q, s, samp, 
small, strike, strong, sub, sup, tt, var, 
b, u, i, center, 
dl, dt, dd, ol, ul, li, 
fieldset, form, label, legend, 
table, caption, tbody, tfoot, thead, tr, th, td, 
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary, 
time, mark, audio, video { 
    margin: 0; 
    padding: 0; 
    border: 0; 
    font-size: 100%; 
    font: inherit; 
    vertical-align: baseline; 
} 
/* HTML5 display-role reset for older browsers */ 
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section, main { 
    display: block; 
} 
body { 
    line-height: 1; 
} 
ol, ul { 
    list-style: none; 
} 
blockquote, q { 
    quotes: none; 
} 
blockquote:before, blockquote:after, 
q:before, q:after { 
    content: ''; 
    content: none; 
} 
table { 
    border-collapse: collapse; 
    border-spacing: 0; 
} 

風格自由tempalte .css找到它here

我不能發表這個,因爲它會通過3k標記張貼。

+0

它會更容易解決,如果我們能夠看到最終的HTML,而不是在PHP文件。 –

+0

嘿,我編輯了原文。在它的底部有我的html filke的最終輸出 – Demeteor

+0

是否有可能看到活動源?上面的代碼引用了自定義樣式(reset.css,style.css),而不顯示它們如何影響整體代碼。這也有助於清楚地說明你的DESIRED結果,而不是你展示的截圖。 –

回答

1

您提供的HTML包含錯誤和不一致;我強烈建議您查看您的模板提供的代碼,以確保這些錯誤不會導致意外的呈現問題。

話雖這麼說,我已經創建了一個的jsfiddle陳列宣傳修正HTML瀏覽:

https://jsfiddle.net/embed/1pfz7yg2/show/

你可以看到HTML/CSS這裏:https://jsfiddle.net/embed/1pfz7yg2/

從我瞭解你的期望的輸出,您希望左側導航保持靜態。既然如此,CSS最相關的位:

.cd-side-nav { position: fixed; }

+0

嘿謝謝你的幫助,非常感謝,我會直接去工作,然後檢查其他HTML文件的相同錯誤。 感謝您的時間 – Demeteor

相關問題