douqin2108
2016-08-22 10:38
浏览 38
已采纳

包含文件时,引导网格不起作用

I already made a homepage including the grid system of bootstrap, but now im using mainly includes to keep everything tidy but the grid system doesnt seem to work at all. even if i copy the example code of bootstrap itself.

this is the first code of my content php file. including obviously the row part. These are stacked ontop of eachother not next to eachother.

PS: the .content-wrapper has no styling yet so its not affecting anything and the .content has only top and bottom padding.

<div class="content-wrapper">
<div class="content">
        <h1>The Test Heading</h1>
        <p>
          text
        </p>
</div>

<div class="row">
  <div class="col-sm-6 col-md-6">
    <div class="thumbnail">
      <img src="..." alt="...">
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
    <div class="thumbnail">
      <img src="..." alt="...">
      <div class="caption">
        <h3>Thumbnail label</h3>
        <p>...</p>
        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
      </div>
    </div>
  </div>
</div>

here is the index.php file i got with the content area

 <div class="container">
 <!-- Navigation area -->
 <?php include_once ("php/navigation.php");?>
 <!-- Carousel -->
 <?php include_once ("php/carousel.php");?>
 <!-- Content area -->
 <?php include_once ("php/content.php");?>
 </div> <!-- end of container -->

im not sure if it has to do something with including a file and the grid system, but carousel, container etc all working fine so it should find the css file after being included.

Sidequestion: is a method like this useful? working with includes only? or is it rather non-practical?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douhanzhen8927 2016-08-22 11:00
    已采纳

    So what do u want to do with grid system, because you only have one col so it will just go from begining of file to col 6 it will look like it doesnt do anything rly? You can put lets say and then your div with col and it will move it and so on.

    打赏 评论

相关推荐 更多相似问题