2014-04-01 3 views
-3

누군가 6 개의 버튼을 어떻게 배치 할 수 있는지 궁금합니다. 3 개의 버튼이 맨 위에 있고 다른 3 개가 맨 위 행 아래에 있도록 원하는 것이 있습니다. 기본적으로 두 개의 정렬 된 버튼 행이 있습니다.CSS를 사용하여 행을 만들었습니다

저는 이전 게시물에 대한 답변을 얻었지만 html 태그가 작동하지 않기 때문에 CSS 만 사용해야한다는 점을 잊어 버렸습니다.

정말 도움이됩니다. 감사.

+0

<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> 

당신은 아무것도 시도

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

또는

HTML? – 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> 

또는 CSS

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