0
나는이에 상당히 새로운 오전 내 자신이 내용에 대한 그려 마진로 된 div를 사용하여 내부 대신이 같은 패딩을 사용하여 찾을 수 :는
<div class="container" style="width:100%; height:500px; positon:relative;">
<div class="subcontainer" style="width:25%; height:100%; position:relative; float:left;">
\t <div class="subcontainer" style="width:100%; height:40%; position:relative; overflow:visible;">
\t \t <img src="" style="width:200px; height:200px; position:absolute; top:50%; left:50%; transform:translate(-50%, -50%);">
\t \t </div>
\t \t <div class="subcontainer" style="width:100%; height:60%; position:relative;">
\t \t <div class="marcontainer" style="position:absolute; width:80%; height:80%; top:50%; left:10%; transform:translateY(-50%); text-align:left;">
\t \t \t <h5>Build a website</h5>
\t \t \t \t <h6>You'll learn the basics to building a website with an introduction to text editors, basic HTML tags, and advanced HTML skills.</h6>
\t \t \t \t <a href="#"><h6>Leer más</h6></a>
\t \t \t
\t \t \t </div>
\t \t </div>
\t </div>
\t <div class="subcontainer" style="width:25%; height:100%; position:relative; float:left;">
\t <div class="subcontainer" style="width:100%; height:40%; position:relative; overflow:visible;">
\t \t <img src="" style="width:200px; height:200px; position:absolute; top:50%; left:50%; transform:translate(-50%, -50%);">
\t \t </div>
\t \t <div class="subcontainer" style="width:100%; height:60%; position:relative;">
\t \t <div class="marcontainer" style="position:absolute; width:80%; height:80%; top:50%; left:10%; transform:translateY(-50%); text-align:left;">
\t \t \t <h5>Build a website</h5>
\t \t \t \t <h6>You'll learn the basics to building a website with an introduction to text editors, basic HTML tags, and advanced HTML skills.</h6>
\t \t \t \t <a href="#"><h6>Leer más</h6></a>
\t \t \t
\t \t \t </div>
\t \t </div>
\t </div>
\t <div class="subcontainer" style="width:25%; height:100%; position:relative; float:left;">
\t <div class="subcontainer" style="width:100%; height:40%; position:relative; overflow:visible;">
\t \t <img src="" style="width:200px; height:200px; position:absolute; top:50%; left:50%; transform:translate(-50%, -50%);">
\t \t </div>
\t \t <div class="subcontainer" style="width:100%; height:60%; position:relative;">
\t \t <div class="marcontainer" style="position:absolute; width:80%; height:80%; top:50%; left:10%; transform:translateY(-50%); text-align:left;">
\t \t \t <h5>Build a website</h5>
\t \t \t \t <h6>You'll learn the basics to building a website with an introduction to text editors, basic HTML tags, and advanced HTML skills.</h6>
\t \t \t \t <a href="#"><h6>Leer más</h6></a>
\t \t \t
\t \t \t </div>
\t \t </div>
\t </div>
\t <div class="subcontainer" style="width:25%; height:100%; position:relative; float:left;">
\t <div class="subcontainer" style="width:100%; height:40%; position:relative; overflow:visible;">
\t \t <img src="" style="width:200px; height:200px; position:absolute; top:50%; left:50%; transform:translate(-50%, -50%);">
\t \t </div>
\t \t <div class="subcontainer" style="width:100%; height:60%; position:relative;">
\t \t <div class="marcontainer" style="position:absolute; width:80%; height:80%; top:50%; left:10%; transform:translateY(-50%); text-align:left;">
\t \t \t <h5>Build a website</h5>
\t \t \t \t <h6>You'll learn the basics to building a website with an introduction to text editors, basic HTML tags, and advanced HTML skills.</h6>
\t \t \t \t <a href="#"><h6>Leer más</h6></a>
\t \t \t
\t \t \t </div>
\t \t </div>
\t </div>
</div>
좋은 방법입니까? 그것은 제가 만들고자하는 페이지의 레이아웃을 시각화하는 데 도움이되지만, 불필요하게 물건을 어수선하게 만들지는 모르겠습니다. 나를 위해 이해하는 것이 좋다.
paddig를 사용할 때보다 80 % 너비와 높이의 div를 사용할 때 왜 다른 결과를 얻을 수 있는지 설명 할 수 있습니까? : 10 %? 똑같은 결과를 주어야하지만 패딩이 안되나요? – gabogabans
여기를보십시오 : http://www.tipue.com/blog/center-a-div/ –