<div>
<a href="http://www.naver.com" target="_blank">네이버로 이동</a>
</div>
<section>
<a href="http://www.google.com" target="_blank">구글로 이동</a>
<a href="http://www.google.com" target="_blank">구글로 이동</a>
<article></article>
</section>
<nav>
<a href="http://www.daum.net" target="_blank">다음으로 이동</a>
</nav>
div, section, nav {
border:10px dotted red;
margin:50px;
padding:20px;
}
section{
text-align : center;
}
/*왜 후손선택이나 자식선택으로 하면 안될까*/
nav{
text-align : right;
}
a {
background-color:gold;
}
section article {
width:200px;
height:200px;
background-color:blue;
}
<div>
<a href="http://www.naver.com" target="_blank">네이버로 이동</a>
</div>
<section>
<a href="http://www.google.com" target="_blank">구글로 이동</a>
<a href="http://www.google.com" target="_blank">구글로 이동</a>
<div>
<article></article>
</div>
</section>
<nav>
<a href="http://www.daum.net" target="_blank">다음으로 이동</a>
</nav>
div, section, nav {
border:10px dotted red;
margin:50px;
padding:20px;
}
a {
background-color:gold;
}
section article {
width:200px;
height:200px;
background-color:blue;
display:inline-block;
}
section {
text-align:center;
}
nav {
text-align:right;
}
a태그의 영역은 inline 이기 때문에 영역에서 자동정렬할 영역이 없어서 section에서 중앙정렬 속성을 주어야함
section영역의 article 네모를 중앙정렬 하고 싶다면: