[英]Why do I keep getting an extra line in my text?
我正在编写一段访问代码,以“引导”用户完成特定过程。 基本 HTML 代码中的代码在 Access 文本框控件中显示为常规文本。
我的文字需要看起来像:
<div>Steps Taken:</div> <div> </div> <div>1. Batchfile or email has been used to open this project.</div> <div>2. Select/Deselect the necessary Folder checkbox.</div> <div> (Complete One at a time.)</div> <div> 2a. Analytical Lab Selected</div> <div>3. Adjust optTextTypes as necessary or click "Skip This Step".</div> <div>4. Adjust Project Status as Necessary (Most New Requests</div> <div> will have a Project Status of "In Progress".)</div> <div>5. Adjust Project Status Notes for this Release then click</div> <div> ("Skip This Step".)</div> <div>6. <span style="color: #ff0000;">Add, ignore, or change LIMS Parent Project Number</span></div> <div><span style="color: #ff0000;"> and then click ("Skip This Step".)</span></div>
但是,它仍然看起来像:
<div><font color=black>Steps Taken:</font></div> <div> </div> <div><font color=black>1. Batchfile or email has been used to open this project.</font></div> <div><font color=black>2. Select/Deselect the necessary Folder checkbox. </font></div> <div><font color=black> (Complete One at a time.)</font></div> <div><font color=black> 2a. Analytical Lab Selected</font></div> <div><font color=black>3. Adjust optTextTypes as necessary or click "Skip This Step".</font></div> <div><font color=black>4. Adjust Project Status as Necessary (Most New Requests</font></div> <div><font color=black> will have a Project Status of "In Progress".)</font></div> <div><font color=black>5. Adjust Project Status Notes for this Release then click</font></div> <div><font color=black> ("Skip This Step".)</font></div> <div><font color=black>6. </font></div> <div><font color=red>Add, ignore or change LIMS Parent Project Number</font></div> <div><font color=red> and then click ("Skip This Step".)</font></div>
我不能让它在这里显示问题,但基本上,在显示 #6 之后,句子会跳过一个完整的行。 我已将代码粘贴到其他 HTML 在线版本中,它显示了行跳过。 我让它在在线版本上运行,复制 HTML 并将其粘贴回我的访问应用程序,但再次发生跳行。
不知道我应该看什么才能让它工作?
发生这种情况是因为div
是 html块元素。 这意味着当您使用它时,每个新的 div 都以新行开始。
因此,由于 2 div
s,您的第 6 点和它旁边的文本在不同的行中移动。 我建议为您的文本使用span
,因为它不是块元素。
以下是您可以用于第 6 点的代码:
<div><font color=black>6.
<span style="color:red"> Add, ignore or change LIMS Parent Project Number </span>
</font></div>
此外,为了让您的工作更轻松,我建议使用HTML
的有序列表。
下面是我为您创建的 plnkr 示例。 它具有最小样式的有序列表。 https://plnkr.co/edit/fjA60WtwsL9IhzSK?open=lib%2Fscript.js&preview
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.