Reputation:
I have code that looks like this:
<h4 class="tableTotals">Total Selected: R<div id="bankTotal">##,##</div></h4>
The output that I want should all be in ONE line but as it turns out the div tags displays it's content in a new line, which I don't exactly want. So the output looks like this:
Total Selected: R
##,##
When I actually want it to display like this:
Total Selected: R##,##
Does anybody know how to stop the div displaying on a new line? Thank for any push in the right direction!
Upvotes: 3
Views: 9033
Reputation: 3
Here I have added a style to position the DIV manually to where you want it to be. Please note that I didn't put it in its exact position so just fiddle with the margin PX.
<h4 class="tableTotals">Total Selected: R<div id="bankTotal" style="margin-left:50px;margin-top:-10px;">##,##</div></h4>
Upvotes: 0
Reputation: 78971
Style your div to be displayed as inline-block
#bankTotal { display: inline-block; }
Using inline-block
does not have to chang the div
completely into as inline
element just like span
. Furthermore, you can still have block properties.
Upvotes: 3
Reputation: 218722
<h4 class="tableTotals" style="display:inline;">Total Selected: R<div id="bankTotal" style="float:left;">##,##</div></h4>
Upvotes: 0
Reputation: 3028
display:inline
property of css for displaying the div "inline",
or u could use <span>
tag instead of <div>
tag ..
Upvotes: 0
Reputation: 108
<div> is a block element and will put a return before and after the <div>
You should use instead.
<h4 class="tableTotals">Total Selected: R<span id="bankTotal">##,##</span></h4>
Upvotes: 2
Reputation: 4778
Use <span>
instead of <div>
div is a block element, and h4 is a header meant for single line.
Upvotes: 6
Reputation: 148524
div displaying on a new line ?
<div id="bankTotal" style="display:inline">##,##</div>
or
<div id="bankTotal" style="float:left">##,##</div>
but better :
<span id="bankTotal" >##,##</span >
Upvotes: 1