There is no newline, just the div
is a block element.
You can make the div
inline by adding display: inline
, which may be what you want.
div.noWrap {
display: inline;
}
This works like magic, use it in the CSS file on the div you want to have on the new line:
.div_class {
clear: left;
}
Or declare it in the html:
<div style="clear: left">
<!-- Content... -->
</div>
<div style="display: inline">Is this what you meant?</div>
Have you considered using span
instead of div
? It is the in-line version of div
.
This works the best, in my case, I tried it all
.div_class {
clear: left;
}
Quoting Mr Initial Man from here:
Instead of this:
<div id="Top" class="info"></div><a href="#" class="a_info"></a>
Use this:
<span id="Top" class="info"></span><a href="#" class="a_info"></a>
Also, you could use this:
<div id="Top" class="info"><a href="#" class="a_info"></a></div>
And gostbustaz:
If you absoultely must use a
<div>
, you can setdiv { display: inline; }
in your stylesheet.
Of course, that essentially makes the
<div>
a<span>
.
Source: Stackoverflow.com