【发布时间】:2015-10-28 22:46:07
【问题描述】:
这是一个奇怪的问题,我想知道为什么会这样..
我正在使用Yii2 框架并创建了一个widget 以从Twitter bootstrap 呈现缩略图,如果需要,我已经编写了呈现多个按钮的代码,但是当我呈现多个按钮时,它们彼此之间似乎没有任何空间,我检查了HTML 代码,它似乎很好,我什至将视图与两个相同的代码进行了比较,一个来自PHP,另一个来自HTML,
这就是它的样子,两者都有相同的 HTML 代码,但第一个是从 PHP 呈现的
HTML的代码是这样的,两种情况的代码相同,不同的是第一个来自php
<div class="thumbnail">
<div class="caption">
<h3>testing</h3>
<p>Lorem ipsum dolor</p>
<p>
<button type="button" class="btn btn-default" name="/localhost/backend/web/site/index">Button</button>
<button type="button" class="btn btn-default" name="/localhost/backend/web/site/index">Button</button>
<button type="button" class="btn btn-default" name="/localhost/backend/web/site/index">Button</button>
</p>
</div>
</div>
<div class="thumbnail">
<div class="caption">
<h3>testing</h3>
<p>Lorem ipsum dolor</p>
<p>
<button type="button" class="btn btn-default" name="/localhost/backend/web/site/index">Button</button>
<button type="button" class="btn btn-default" name="/localhost/backend/web/site/index">Button</button>
<button type="button" class="btn btn-default" name="/localhost/backend/web/site/index">Button</button>
</p>
</div>
</div>
【问题讨论】:
-
请张贴这两种情况的代码。它们不一样,否则它们会呈现相同的效果!
-
@miken32 代码已添加
-
这是不可能的。浏览器只接收 html,但永远不知道服务器端发生了什么。很可能,当您使用 php 时,它会修剪周围的空白。
标签: php html twitter-bootstrap echo