두 개의 열을 나란히 표시하려고합니다 (왼쪽에 4 개 항목이 있고 오른쪽에 3 개, 총 7 개 항목이 있음).
#wrap{
width:600px;
margin:0px auto;
column-count: 2;
}
#left_col {
float:left;
width:200px;
}
#right_col{
float: right;
width: 200px;
}
<div id="wrap">
<div id="left_col">
<a href="number1.php"><img src="number1.png"alt="number1" border="0" align="top" height="65" width="75"/>num1</a>
<a href="number2.php"><img src="number2.png"alt="number2" border="0" align="top" height="65" width="75"/>num2</a>
<a href="number3.php"><img src="number3.png"alt="number3" border="0" align="top" height="75" width="65"/>num3</a>
<a href="number4.php"><img src="number4.png"alt="number4" border="0" align="top" height="65" width="75"/>num4</a>
</div>
<div id="right_col">
<a href="num1.php"><img src="num1.png"alt="num1" border="0" align="top" height="65" width="75"/>number1</a>
<a href="num2.php"><img src="num2.png"alt="num2" border="0" align="top" height="65" width="75"/>number2</a>
<a href="num3.php"><img src="num3.png"alt="num3" border="0" align="top" height="65" width="75"/>number3</a>
</div>
</div>
그리고 내 문제는 그것을 실행할 때의 링크 / 이미지 / 텍스트가에서 left_col
와 같이 각 행에 하나의 항목으로 표시 right_col
되지 않고 아래 줄에있는 것처럼 함께 텍스트를 표시하지 않는다는 것입니다. 그것.
태그 display:block
에 추가 a
:
#wrap{
width: 600px;
margin: 0px auto;
}
#left_col {
float: left;
width: 200px;
}
#right_col{
float: right;
width: 200px;
}
a {
display: block;
}
<div id="wrap">
<div id="left_col">
<a href="number1.php"><img src="http://lorempixel.com/75/65/technics/1" alt="number1" height="65" width="75"/> Number 1</a>
<a href="number2.php"><img src="http://lorempixel.com/75/65/technics/2" alt="number2" height="65" width="75"/> Number 2</a>
<a href="number3.php"><img src="http://lorempixel.com/65/75/technics/3" alt="number3" height="75" width="65"/> Number 3</a>
<a href="number4.php"><img src="http://lorempixel.com/75/65/technics/4" alt="number4" height="65" width="75"/> Number 4</a>
</div>
<div id="right_col">
<a href="num1.php"><img src="http://lorempixel.com/75/65/technics/5" alt="num1" height="65" width="75"/> Number 1</a>
<a href="num2.php"><img src="http://lorempixel.com/75/65/technics/6" alt="num2" height="65" width="75"/> Number 2</a>
<a href="num3.php"><img src="http://lorempixel.com/75/65/technics/7" alt="num3" height="65" width="75"/> Number 3</a>
</div>
</div>
그러나 이상적으로는 목록을 사용하여 수행해야합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다