dreamfly2016 2017-04-10 19:55
浏览 161
已采纳

如何设置引导面板的大小?

So I am making a webpage using panels. The idea is to fetch rows from database and display it on panels. I set the width of the panel-primary to 15% and visually it resized the panel to 15%. I want to make the panel clickable so I added an (<'a'>) surrounding the panel to my surprise that even though the panel is visually 15% in size, it still takes the whole horizontal space. Notice the cursor is a hand

enter image description here

I attach my code for this part:

<?php
$sql = "SELECT * FROM pembelitkataku";
$result = mysqli_query($db, $sql);
while($row = $result->fetch_array())
{
?>
<a href="">
    <div class="panel panel-primary" style="width: 15%">
        <div class="panel-heading"><?php echo $row['text']; ?></div>
        <div class="panel-body"><?php echo "<img src = 'images/".$row['image']."' width=\"100\">"?></div>
    </div>
</a>
<?php
}
?>

My question is, how do I visually and physically change the panel size to 15% so that I can put multiple panels side by side?

  • 写回答

2条回答 默认 最新

  • doushi9474 2017-04-10 20:17
    关注

    Anchors are inline elements, not block level. you should put your anchors inside the panel div, not wrapping it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥15 小红薯封设备能解决的来
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答
  • ¥20 在本地部署CHATRWKV时遇到了AttributeError: 'str' object has no attribute 'requires_grad'
  • ¥15 vue+element项目中多tag时,切换Tab时iframe套第三方html页面需要实现不刷新
  • ¥50 深度强化学习解决能源调度问题
  • ¥15 一道计算机组成原理问题