Reputation: 25359
How can I get "Current data: " and whatever value the #dataset_name paragraph takes to appear on one line?
<div id="current_data">Current dataset: <p id="dataset_name"></p></div>
thanks!
Upvotes: 0
Views: 90
Reputation: 102423
Why not
<p id="current_data">Current dataset: <span id="dataset_name"></span></p>
It makes more semantical sense (as long as its not really a table).
Upvotes: 1
Reputation: 4061
Try to use:
<div id="current_data">Current dataset: <span id="dataset_name"></span></div>
Spans are, by default, inline
elements, p
and div
are block
elements (therefore, they add a "newline"). You could also use <p style="display: inline;">...</p>
, but it's better to use span
in these cases.
Upvotes: 3
Reputation: 7668
<p>
elements are considered blocks by HTML while normal text is inline.
In your CSS put:
p {
display: inline;
}
and you'll be good.
Upvotes: 2