最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How would I make this text appear on one line? - Stack Overflow

programmeradmin1浏览0评论

I have this webpage. Here is the raw HTML page.

<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?

I have this webpage. Here is the raw HTML page.

<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?

Share Improve this question edited Apr 15, 2014 at 18:29 Robert Harvey 181k48 gold badges348 silver badges513 bronze badges asked Apr 15, 2014 at 18:21 user3529680user3529680 133 bronze badges 3
  • 5 I'm sorry, but I'm not clicking on random links. Put your code here, in your question, otherwise when you solve your problem this entire question bees immediately meaningless and nonsensical to future users. – David Thomas Commented Apr 15, 2014 at 18:27
  • 1 Stack Overflow etiquette requires that you include your relevant code here, in the question itself, not in an offsite link. – Robert Harvey Commented Apr 15, 2014 at 18:27
  • Sorry, I did not know this. I will keep it in mind for next time. – user3529680 Commented Apr 15, 2014 at 19:32
Add a ment  | 

3 Answers 3

Reset to default 8

Instead of using a <div id="output"> you could use <span id="output"> which is inherently inline.

Alternatively you could style the <div> with #output { display: inline-block;}.

Use <span> instead of <div>

Use a span instead of a div

<body>
    <p>GBN: <span id="output"></span>KH/s</p>
</body>
发布评论

评论列表(0)

  1. 暂无评论