简体   繁体   English

我如何让这个文本出现在一行上?

[英]How would I make this text appear on one line?

I have this webpage.我有这个网页。 Here is the raw HTML page.是原始 HTML 页面。

<body>
        <p>GBN: <div id="output"></div>KH/s</p>
</body>

My problem is that the words are on different lines.我的问题是这些词在不同的行上。 How would I make it so that the worlds 'GBN:', '0' and 'KH/s' appear all on the same line?我如何才能让世界“GBN:”、“0”和“KH/s”都出现在同一行上?

Instead of using a <div id="output"> you could use <span id="output"> which is inherently inline.除了使用<div id="output">您可以使用<span id="output">它本身是内联的。

Alternatively you could style the <div> with #output { display: inline-block;} .或者,您可以使用#output { display: inline-block;}设置<div>样式。

使用<span>而不是<div>

Use a span instead of a div使用跨度而不是 div

<body>
    <p>GBN: <span id="output"></span>KH/s</p>
</body>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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