수

버튼 그룹

· 2017-09-09 (토) 23:56:03 · 2059

버튼 그룹

91308e91ff090fb4abed793c1e3856ce_1504969001_1091.png

여백을 제거 float:left하고 각 단추에 추가 하여 단추 그룹을 만듭니다.


예

.button {

    float: left;

}

[전체소스]

<!DOCTYPE html>
<html>
<head>
<style>
.btn-group .button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    float: left;
}

.btn-group .button:hover {
    background-color: #3e8e41;
}
</style>
</head>
<body>

<h2>Button Groups</h2>
<p>Remove margins and float the buttons to create a button group:</p>

<div class="btn-group">
  <button class="button">Button</button>
  <button class="button">Button</button>
  <button class="button">Button</button>
  <button class="button">Button</button>
</div>

<p style="clear:both"><br>Remember to clear floats after, or else will this p element also float next to the buttons.</p>

</body>
</html>
 
|
댓글을 작성하시려면 로그인이 필요합니다.

퍼블리셔팁

1,282건

퍼블리싱과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
CSS 17-10-11 조회 2,716
CSS 17-10-11 조회 2,713
HTML 17-10-07 조회 3,519
HTML 17-10-06 조회 3,367
CSS 17-09-29 조회 2,302
CSS 17-09-29 조회 2,666
CSS 17-09-29 조회 2,524
CSS 17-09-26 조회 4,056
CSS 17-09-26 조회 2,720
CSS 17-09-26 조회 1,929
CSS 17-09-22 조회 2,240
CSS 17-09-22 조회 2,404
CSS 17-09-22 조회 2,368
HTML 17-09-22 조회 4,784
CSS 17-09-21 조회 1,921
CSS 17-09-21 조회 2,051
CSS 17-09-21 조회 1,913
CSS 17-09-19 조회 1,947
CSS 17-09-19 조회 1,631
CSS 17-09-19 조회 1,490
CSS 17-09-18 조회 2,582
CSS 17-09-18 조회 2,380
CSS 17-09-18 조회 2,363
CSS 17-09-14 조회 2,411
CSS 17-09-14 조회 2,086
CSS 17-09-14 조회 2,138
CSS 17-09-11 조회 2,470
CSS 17-09-11 조회 2,319
CSS 17-09-11 조회 2,123
CSS 17-09-10 조회 1,987