dpbtbcz6650 2017-09-06 09:17
浏览 73
已采纳

Php将<h5>标签置于错误的方式

I have this code, that generates the menu from sql.

<footer class="footer-basic-centered">
  <p class="footer-links">
    <?php 
    $top_menuDown = mysqli_query($kapcs, "SELECT * FROM top_menu WHERE latszik = 1 AND (top_menu_place = 1 OR top_menu_place = 0) ORDER BY top_menu_sorrend ASC");
    if(mysqli_num_rows($top_menuDown) > 0 )
    {
        while($top_nav = mysqli_fetch_assoc($top_menuDown))
        {
            echo '<a class="footer_menu_to_link" href="'.$host.'/'.$top_nav['top_menu_seo'].'" title="'.$top_nav['top_menu_nev'].'"><h5 class="kat_h5">'.$top_nav['top_menu_nev'].'</h5></a>'."
";
        }
    }
    ?>
  </p>
  <h6 class="copy"><p class="footer-company-name"><?php echo date("Y"); ?> <?php echo $siteName; ?> &copy;  - Minden jog fentartva!</p></h6>
</footer>

As you can see it on the image i uploaded, at the first link, the <h5> tag is outside the <a>. The other links are okay.

Whats going on there?

enter image description here

  • 写回答

1条回答 默认 最新

  • doupu0619 2017-09-06 09:30
    关注

    You are putting a h5 in an a that is in a p. That is not going to do what you think.

    The p will get closed automatically when you add a new block-level element like a h5.

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

报告相同问题?

悬赏问题

  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据