0

I have a div with two paragraph elements inside like so:

<div id="statsDiv"">
  <p id="scoreCounter">Score: </p>
  <p id="timeCounter">Time: </p>
</div>

It shows this:

Score:

Time:

I don't want a gap between the two elements, such that it gets shown like so:

Score:
Time:

The above was done with the following HTML:

Score:<br>
Time:

I also don't want the two elements to be one, since I am making a web game ando nly want to have to modify one of the two, not have to update both each time.

I also want to stick an options button inside of the same div.

Is there some CSS I could use to remove the line break between the two? Or else some different element that I could use to have the text able to be selected by their ID and have the inside text changed?

Paulie_D
  • 107,962
  • 13
  • 142
  • 161
  • Questions seeking code help must include the shortest code necessary to reproduce it **in the question itself** preferably in a [**Stack Snippet**](https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/). See [**How to create a Minimal, Reproducible Example**](http://stackoverflow.com/help/reprex) – Paulie_D Jun 15 '22 at 19:48
  • Try `.statsDiv { display: inline; }`? – bryce Jun 15 '22 at 19:48
  • remove the default margin between p – Temani Afif Jun 15 '22 at 19:51

1 Answers1

0

 <div id="statsDiv"">
  <p id="scoreCounter">Score: <br><span>Time:</span></p>

</div>

strong text

Alimpy
  • 1
  • 1