You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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.

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:37:47