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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 python中transformers可以正常下载,但是没有办法使用pipeline
  • ¥50 分布式追踪trace异常问题
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改
  • ¥15 Windows 系统cmd后提示“加载用户设置时遇到错误”
  • ¥50 vue router 动态路由问题
  • ¥15 关于#.net#的问题:End Function
  • ¥15 无法import pycausal
  • ¥15 weditor无法连接模拟器Local server not started, start with?
  • ¥20 6-3 String类定义