logo

Flexbox 사이에 공간을 설정하는 방법은 무엇입니까?

Flexbox 사이의 공간 설정 항목에는 다음과 같은 속성을 사용하는 것이 포함됩니다. 정당화 내용 다음과 같은 값을 가진 사이의 공간 또는 우주 주변 , 그리고 , 주축을 따라 항목 사이의 공간을 균등하게 분배하여 유연한 컨테이너에서 레이아웃 간격과 정렬을 향상시킵니다.

다음과 같은 접근 방식이 있습니다.

내용의 테이블



1. justify-content 속성을 사용합니다.

그만큼 정당화 콘텐츠 속성 ~에 CSS 플렉스박스 주축을 따라 플렉스 항목을 정렬합니다. flex-start, flex-end, center, space-between, space-around, space-evenly와 같은 값을 사용하여 항목 사이에 공간을 분배하고 Flex 컨테이너 내의 정렬과 간격을 제어할 수 있습니다.

통사론:

  • space-between 값은 행 사이에 공백이 있는 플렉스 항목을 표시하는 데 사용됩니다.
justify-content: space-between;>
  • space-around 값은 행 사이, 앞, 뒤에 공백이 있는 플렉스 항목을 표시하는 데 사용됩니다.
justify-content: space-around;>

예: 이 예에서는 CSS Flexbox에서 justify-content를 사용하여 항목 사이에 공간을 분배하는 방법을 보여줍니다. space-around는 항목 주위에 동일한 공간을 만드는 반면, space-around는 항목 사이에 동일한 공간을 배치합니다.

HTML
   Flexboxtitle 사이의 공백><style>.flex2 { 디스플레이: 플렉스;  justify-content: 공백 주변;  배경색: 녹색;  } .flex3 { 디스플레이: 플렉스;  내용 정당화: 공백 사이;  배경색: 녹색;  } .flex-items { 배경색: #f4f4f4;  너비: 100px;  높이: 50px;  여백: 10px;  텍스트 정렬: 중앙;  글꼴 크기: 40px;  } h3 { 텍스트 정렬: 중앙;  } .geeks { 글꼴 크기: 40px;  텍스트 정렬: 중앙;  색상: #009900;  글꼴 두께: 굵게;  } 스타일> 머리> <body> <div>techcodeview.comdiv><h3>Flexboxh3 사이의 공간> <br>  <b>justify-content: 주변 공백 b><div> <div>1div><div>2div><div>3div> div> <br>  <b>내용 정당화: b> 사이의 공백<div> <div>1div><div>2div><div>3div> div> <br>본문> html>></pre> </code> <p dir='ltr'>  <b>  <strong>산출:</strong>  </b>  </p> <p dir='ltr'> <img src='//techcodeview.com/img/css-misc/95/how-set-space-between-flexbox.webp' alt="Flexbox 사이의 공간 설정"></p> <h2 id='2-using-the-gap-property-to-set-space'>  <b>  <strong>2</strong>  </b>  <span>. 사용하여</span>  <b>  <strong>간격 속성</strong>  </b>  <span>공간을 설정하기 위해</span></h2><p dir='ltr'><span>그만큼</span> <span>CSS의 간격 속성</span> <span>Flexbox 또는 Grid 항목 사이에 공간을 설정합니다. 행 간격(row-gap)과 열 간격(column-gap)의 약칭으로, 추가 여백이나 안쪽 여백 없이 일관되게 간격을 관리하기 쉽고 레이아웃 제어 및 가독성이 향상됩니다.</span></p><blockquote style="text-transform: capitalize;font-size: 20px; padding: 10px;"><a href="/java-string-contains">문자열.자바 포함</a>
</blockquote> <p dir='ltr'>  <b>  <strong>통사론:</strong>  </b>  </p> <pre class='hljs'>gap: value;></pre><p dir='ltr'>  <b>  <strong>예:</strong>  </b>  <span>이 예에서는 flexbox 속성과 함께 gap 속성을 사용하여 개별 항목 사이에 간격을 추가합니다.</span></p>HTML<code class='hljs'> <pre class='hljs'> <html> <head> <style>.flex-container { 디스플레이: 플렉스;  간격: 20px;  /* Flex 항목 사이에 원하는 간격을 설정합니다. */ } .flex-item { background-color: lightblue;  패딩: 10px;  } .geeks { 글꼴 크기: 40px;  색상: #009900;  글꼴 두께: 굵게;  } 스타일> 머리> <body> <div>techcodeview.comdiv><h3>간격 속성 사용h3><div> <div>요소 1div><div>요소 2div><div>요소 3div> div> 본문> html>></pre> </code> <p dir='ltr'>  <b>  <strong>산출:</strong>  </b>  </p>  <img src='//techcodeview.com/img/css-misc/95/how-set-space-between-flexbox-2.webp' alt="">  <br>  <br></article><div class="rekl_placeholder"><script type="text/javascript">atOptions = {'key' : 'f2b09f3e7178b263531e10998e9a32fa','format' : 'iframe','height' : 250,'width' : 300,'params' : {}};</script><script type="text/javascript" src="//changelesschoir.com/f2b09f3e7178b263531e10998e9a32fa/invoke.js"></script></div> </article>
                         
                        </div><!--//content-->
                    </div><!--//section-inner-->                 
                </section><!--//section-->
    
            </div><!--//primary-->
            <div class="secondary col-md-4 col-sm-12 col-xs-12">
                  <aside class="info aside section">
                    <div class="section-inner">
                        <h2 class="">범주</h2>
                        <div class="content">
                            <ul class="list-unstyled">
                                <li> <a href="/c-loops-control-statements/">C-루프 및 제어문</a> </li><li> <a href="/about-us/">우리에 대해</a> </li><li> <a href="/python-exceptions/">Python 예외</a> </li><li> <a href="/cube-puzzles/">큐브 퍼즐</a> </li><li> <a href="/advance-java/">고급 자바</a> </li><li> <a href="/chemistry-difference-between/">화학-차이-사이</a> </li><li> <a href="/java-stringbuffer/">자바 문자열 버퍼</a> </li><li> <a href="/installation-ubuntu/">우분투에 설치</a> </li><li> <a href="/business/">사업</a> </li><li> <a href="/big-endian/">빅엔디안</a> </li>
                                
                            </ul>
                        </div><!--//content-->  
                    </div><!--//section-inner-->                 
                </aside><!--//aside-->
                
                 <aside class="testimonials aside section">
                	 <div class="section-inner">
                        <div class="content">
                            <div class="item">
  								<div class="rekl_placeholder" id="sidebar_placeholder_1"> <script type="text/javascript">atOptions = {'key' : 'f53f1abf3c3a788f849c12a956865db1','format' : 'iframe','height' : 300,'width' : 160,'params' : {}};</script><script type="text/javascript" src="//changelesschoir.com/f53f1abf3c3a788f849c12a956865db1/invoke.js"></script> <br></div>                                                   
                            </div>
                        </div>
                    </div>
                   <div class="section-inner">
                        <h2 class="heading">리눅스의 아키텍처</h2>
                        <div class="content">
                            <div class="item">
                                 <blockquote class="quote">                                  
                                    <span> <i class="fa fa-quote-left"></i> 파일, 디렉토리, 권한, 백업, ls, man, pwd, cd, linux, Linux 소개, chmod, man, 쉘, 파이프, 필터, regex, vi 등에 대한 예제가 포함된 Linux 아키텍처</span>
                                </blockquote>                
                                                                                             
                            </div><!--//item-->
                            
                            <p> <a class="more-link" href="/architecture-linux"> <i class="fa fa-external-link"></i> 자세히보기</a> </p> 
                            
                        </div><!--//content-->
                    </div><!--//section-inner-->
                </aside><!--//section-->
                
               
                            
                 <aside class="languages aside section">
                    <div class="section-inner">
                        <h2 class="heading">재미있는 기사</h2>
                        <div class="content">
                            <ul class="list-unstyled">
                                <li class="item">
                                    <span class="title"> <strong> <a href="/cucumber-testing">오이 테스트</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/what-is-9-16-decimal">9/16을 십진수로 표현하면?</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/what-is-full-form-nmmss">NMMSS의 전체 형태는 무엇입니까</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/complete-list-ncaa-division-3-colleges-1311010">NCAA Division 3 대학 전체 목록(업데이트됨)</a> </strong> </span>
                                    
                                </li><!--//item--><li class="item">
                                    <span class="title"> <strong> <a href="/mysql-update-query">MySQL 업데이트 쿼리</a> </strong> </span>
                                    
                                </li><!--//item-->
                               
                            </ul>
                        </div><!--//content-->
                    </div><!--//section-inner-->
                </aside><!--//section-->
                
              
                 <aside class="list music aside section">
                    <div class="section-inner">
                        <h2 class="heading">인기 게시물</h2>
                        <div class="content">
                            <ul class="list"> <li><a href="/difference-between-fox">늑대 대 여우</a>
</li><li><a href="/numpy-standard-deviation">np 표준</a>
</li><li><a href="/what-is-core-java">자바 코어 자바</a>
</li><li><a href="/java-if-else-statement">if else 문은 자바에서</a>
</li><li><a href="/uppercase-shortcut-excel">엑셀 단축키 모두 대문자</a>
</li><li><a href="/composition-relations">관계 구성</a>
</li> 
                                
                                
                            </ul>
                        </div><!--//content-->
                    </div><!--//section-inner-->
                </aside><!--//section-->
              
            </div><!--//secondary-->    
        </div><!--//row-->
    </div><!--//masonry-->
    
	    <footer class="footer">
        <div class="container text-center">
                <span>
Copyright ©2025 판권 소유 |  <a href="//fi.techcodeview.com/">techcodeview.com</a> | <a href="/disclaimer" rel="nofollow noopener noreferrer" target="_blank">부인 성명</a>  |  <a href="/about-us" rel="nofollow noopener noreferrer" target="_blank">회사 소개</a>  |  <a href="/privacy-policy" rel="nofollow noopener noreferrer" target="_blank">개인 정보 보호 정책</a>  </span>
        </div>
    </footer>
 
         
    <script type="text/javascript" src="https://techcodeview.com/template/assets/plugins/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="https://techcodeview.com/template/assets/plugins/bootstrap/js/bootstrap.min.js"></script>    
    

    <script type="text/javascript" src="https://techcodeview.com/template/assets/js/main.js"></script>     
	
	<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
	<script>
!function(){"use strict";let t=document.createElement("button");t.id="toTopBtn",t.innerHTML="↑";let e=`
        #toTopBtn {
            position: fixed;
            bottom: 25px;
            right: 25px;
            z-index: 9999;
            opacity: 0;
            visibility: hidden;
            background-color: #213141;
            color: white;
            border: none;
            border-radius: 8px;
            width: 50px;
            height: 50px;
            font-size: 24px;
            cursor: pointer;
            transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        }
        #toTopBtn:hover {
            background-color: #555;
        }
    `,i=document.createElement("style");i.type="text/css",i.innerText=e,document.head.appendChild(i),document.body.appendChild(t),window.addEventListener("scroll",()=>{let e=window.scrollY||document.documentElement.scrollTop;e>300?(t.style.opacity="1",t.style.visibility="visible"):(t.style.opacity="0",t.style.visibility="hidden")}),t.addEventListener("click",()=>{window.scrollTo({top:0,behavior:"smooth"})})}();
</script>
</body>
</html>