2014-04-01 30 views
-3

我想知道是否有人能告訴我如何空出6個按鈕。我想要的是三個按鈕位於頂部,而其他三個位於頂部。所以基本上它會是兩排對齊的按鈕。使用css製作按鈕行

我已經得到了像這樣的以前的帖子的答案,但我忘了包括,我需要做它只使用CSS,因爲HTML標籤將無法正常工作。

任何幫助真的很感激。謝謝。

+0

你嘗試過什麼嗎? – celeriko

+0

爲什麼你不能使用HTML? CSS只是風格和做現有的HTML的東西,所以我不明白你爲什麼不能使用它? – Max

+0

如果你需要一些CSS代碼,那麼請顯示你的HTML代碼,否則答覆者當然會給你**他們自己的HTML代碼**。 –

回答

1
<div> 
    <button>one</button> 
    <button>two</button> 
    <button>three</button> 
</div> 
<div> 
    <button>one</button> 
    <button>two</button> 
    <button>three</button> 
</div> 

<button>one</button> 
<button>two</button> 
<button>three</button><br /> 
<button>one</button> 
<button>two</button> 
<button>three</button> 

HTML

<div id="onebox"> 
    <button>one</button> 
    <button>two</button> 
    <button>three</button> 
</div><br /> 
<div id="twobox"> 
    <button>one</button> 
    <button>two</button> 
    <button>three</button> 
</div> 

CSS

#onebox{ 
    width: auto; 
    height: auto; 
    display:inline-block; 
    background-color: red; 
} 
#twobox{ 
    width: auto; 
    height: auto; 
    display:inline-block; 
    background-color: green; 
}