Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Given this HTML:

(鉴于此HTML:)

<div>foo</div><div>bar</div><div>baz</div>

How do you make them display inline like this:

(如何使它们像这样显示内联:)

foo bar baz

(foo bar baz)

not like this:

(不像这样:)

foo

(富)
bar

(酒吧)
baz

(巴兹)

  ask by Steve translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
332 views
Welcome To Ask or Share your Answers For Others

1 Answer

That's something else then:

(那是另一回事:)

 div.inline { float:left; } .clearBoth { clear:both; } 
 <div class="inline">1<br />2<br />3</div> <div class="inline">1<br />2<br />3</div> <div class="inline">1<br />2<br />3</div> <br class="clearBoth" /><!-- you may or may not need this --> 


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...