繁体   English   中英

为什么我的文本中总是多出一行?

[英]Why do I keep getting an extra line in my text?

我正在编写一段访问代码,以“引导”用户完成特定过程。 基本 HTML 代码中的代码在 Access 文本框控件中显示为常规文本。

我的文字需要看起来像:

 <div>Steps Taken:</div> <div>&nbsp;</div> <div>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Batchfile or email has been used to open this project.</div> <div>2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select/Deselect the necessary Folder checkbox.</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Complete One at a time.)</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2a.&nbsp;&nbsp;&nbsp;&nbsp; Analytical Lab Selected</div> <div>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Adjust optTextTypes as necessary or click "Skip This Step".</div> <div>4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Adjust Project Status as Necessary (Most New Requests</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; will have a Project Status of "In Progress".)</div> <div>5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Adjust Project Status Notes for this Release then click</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ("Skip This Step".)</div> <div>6.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #ff0000;">Add, ignore, or change LIMS Parent Project Number</span></div> <div><span style="color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and then click ("Skip This Step".)</span></div>

但是,它仍然看起来像:

 <div><font color=black>Steps Taken:</font></div> <div>&nbsp;</div> <div><font color=black>1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Batchfile or email has been used to open this project.</font></div> <div><font color=black>2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Select/Deselect the necessary Folder checkbox. </font></div> <div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Complete One at a time.)</font></div> <div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2a. &nbsp;Analytical Lab Selected</font></div> <div><font color=black>3. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust optTextTypes as necessary or click &quot;Skip This Step&quot;.</font></div> <div><font color=black>4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust Project Status as Necessary (Most New Requests</font></div> <div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will have a Project Status of &quot;In Progress&quot;.)</font></div> <div><font color=black>5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adjust Project Status Notes for this Release then click</font></div> <div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&quot;Skip This Step&quot;.)</font></div> <div><font color=black>6. &nbsp;&nbsp;</font></div> <div><font color=red>Add, ignore or change LIMS Parent Project Number</font></div> <div><font color=red>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and then click (&quot;Skip This Step&quot;.)</font></div>

我不能让它在这里显示问题,但基本上,在显示 #6 之后,句子会跳过一个完整的行。 我已将代码粘贴到其他 HTML 在线版本中,它显示了行跳过。 我让它在在线版本上运行,复制 HTML 并将其粘贴回我的访问应用程序,但再次发生跳行。

不知道我应该看什么才能让它工作?

发生这种情况是因为div是 html元素。 这意味着当您使用它时,每个新的 div 都以新行开始。
因此,由于 2 div s,您的第 6 点和它旁边的文本在不同的行中移动。 我建议为您的文本使用span ,因为它不是块元素。
以下是您可以用于第 6 点的代码:

<div><font color=black>6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     <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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM