Reputation: 1344
I want this text all on one line, not spaced on two sepearate lines. How can it be done?
<div id="titlefont">
<div id="boldness">This text</div>should be next to each other
</div>
#titlefont {
font-family:arial;
font-size:30px;
text-align:center;
color:#35404c;
}
#boldness {
font-weight:bold;
font-style:italic;
}
Upvotes: 1
Views: 113
Reputation: 22241
By default div
s are rendered as block elements which clear any other elements when not floated.
Fiddle: http://jsfiddle.net/iambriansreed/eu7AW/
CSS:
#boldness {
font-weight:bold;
font-style:italic;
display: inline;
}
Upvotes: 3
Reputation: 4696
You can always float
the div
s or add the display
property when trying to show objects in the same horizontal line.
Read here if you want to align images and text on the same line.
Upvotes: 1