2013-05-10 62 views

回答

0

更改第二divspan

<span class = "two"> 
    Two 
    </span> 

兩個原因:

  • 它不添加任何額外的CSS
  • 這是更多的「語義」有載砍死一個div(而不是兩個div S的內部,以適應span到彼此)

希望這會有所幫助!

這裏有一個鏈接來說明:http://jsfiddle.net/4HxhV/

0

最大的問題是,你必須把它們包裝,這樣就可以正確地顯示它們。我會移動一個。然後將.one和.two類放在.wrapper中,以便它可以包含它們。然後將display:inline-block放在.wrapper div上。看我的例子。 HTML

<div class="wrapper"> 
    <div class = "one"> 
    One 
    </div> 
    <div class = "two"> 
    Two 
    </div> 
</div> 

CSS

.wrapper div{ 
    display: inline-block; 
}