PHP超链接换行实现:解决超链接并排显示问题
Got it, let's fix that so your links show up on separate lines instead of side by side. Here are a few straightforward ways to do it:
1. Add a line break directly (quickest fix)
Just replace the | separators with <br> tags to force a line break between each link:
<a href='<?php echo site_url('inout/inoutverify')?>'>Stock Verification</a><br> <a href='<?php echo site_url('inout/pricehistory')?>'>Price Change History</a>
2. Use an unordered list (more structured)
If you want cleaner, semantic markup (great for navigation), wrap each link in a list item:
<ul> <li><a href='<?php echo site_url('inout/inoutverify')?>'>Stock Verification</a></li> <li><a href='<?php echo site_url('inout/pricehistory')?>'>Price Change History</a></li> </ul>
You can add CSS later to remove default list bullets if you don't want them.
3. Use CSS to make links block-level
If you prefer keeping the inline structure but want them to stack, add a display: block style to the links:
<a href='<?php echo site_url('inout/inoutverify')?>' style='display: block;'>Stock Verification</a> <a href='<?php echo site_url('inout/pricehistory')?>' style='display: block;'>Price Change History</a>
Or better yet, add a class to the links and define the style in your CSS file for reusability:
.nav-link { display: block; margin: 5px 0; /* Optional: add spacing between links */ }
<a href='<?php echo site_url('inout/inoutverify')?>' class='nav-link'>Stock Verification</a> <a href='<?php echo site_url('inout/pricehistory')?>' class='nav-link'>Price Change History</a>
内容的提问来源于stack exchange,提问作者Kanted
相关产品推荐
相关产品推荐

