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 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号