문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 | ||
wiki:css:css_note:css_inline-block [2021/03/18 09:11] emblim98 만듦 |
wiki:css:css_note:css_inline-block [2023/01/13 18:44] (현재) |
||
---|---|---|---|
줄 23: | 줄 23: | ||
====예제==== | ====예제==== | ||
<code css> | <code css> | ||
+ | < | ||
+ | <html lang=" | ||
+ | < | ||
+ | <meta charset=" | ||
+ | <meta http-equiv=" | ||
+ | <meta name=" | ||
+ | < | ||
+ | < | ||
+ | span.a { | ||
+ | display: inline; | ||
+ | /* the default for span */ | ||
+ | width: 100px; | ||
+ | height: 100px; | ||
+ | padding: 5px; | ||
+ | border: 1px solid blue; | ||
+ | background-color: | ||
+ | } | ||
+ | span.b { | ||
+ | display: inline-block; | ||
+ | width: 100px; | ||
+ | height: 100px; | ||
+ | padding: 5px; | ||
+ | border: 1px solid blue; | ||
+ | background-color: | ||
+ | } | ||
+ | span.c { | ||
+ | display: block; | ||
+ | width: 100px; | ||
+ | height: 100px; | ||
+ | padding: 5px; | ||
+ | border: 1px solid blue; | ||
+ | background-color: | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <div> | ||
+ | orem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat scelerisque elit sit amet consequat. Aliquam erat volutpat.< | ||
+ | class=" | ||
+ | </ | ||
+ | < | ||
+ | <div> | ||
+ | orem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat scelerisque elit sit amet consequat. Aliquam erat volutpat.< | ||
+ | class=" | ||
+ | </ | ||
+ | < | ||
+ | <div> | ||
+ | orem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat scelerisque elit sit amet consequat. Aliquam erat volutpat.< | ||
+ | class=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
</ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | =====Using inline-block to Create Navigation Links===== | ||
+ | '' | ||
+ | 하기의 예제는 가로(수평) 방향으로 네비게이션 링크를 만듭니다.\\ | ||
+ | \\ | ||
+ | ====예제==== | ||
+ | <code css> | ||
+ | < | ||
+ | <html lang=" | ||
+ | < | ||
+ | <meta charset=" | ||
+ | <meta http-equiv=" | ||
+ | <meta name=" | ||
+ | < | ||
+ | < | ||
+ | .nav { | ||
+ | background-color: | ||
+ | list-style-type: | ||
+ | text-align: center; | ||
+ | margin: 0; | ||
+ | padding: 0; | ||
+ | } | ||
+ | .nav li { | ||
+ | display: inline-block; | ||
+ | font-size: 20px; | ||
+ | padding: 20px; | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <p> | ||
+ | By default, list items are displayed vertically. In this exmaple, we use display: inline-block to display them horizontally (side by side). | ||
+ | </p> | ||
+ | <p> | ||
+ | Note: If you resize the browser widnow, the links will automatically break when it becomes too crowded. | ||
+ | </p> | ||
+ | <ul class=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ul> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
| | ||
{{tag> | {{tag> |