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 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入