views:

94

answers:

3

I'm constantly modifying some text on a web page with JavaScript. I want the text to be in-line with other elements, like texts, inputs, etc. What HTML element should I use? Both <div> and <p> create new-lines and other things. <b> kind of does what I want, but it bolds all the text. What's the correct alternative?

+11  A: 

The <span> tag is the in-line equivalent of <div>.

Alconja
+5  A: 

<span>

you could also apply a display:inline style to a <div> and get similar results

Geek Num 88
+5  A: 

You can apply a float, inline or inline-block to elements to get them to show up next to other elements. You can also use span.

bobthabuilda