通过html+css隐层div内最后三个<br>的css样式
|
/* 方法1:通用选择器方案 */
div br:nth-last-child(-n+3) {
display: none;
}
/* 方法2:精确控制方案(当div内只有br时) */
div {
display: flex;
flex-direction: column;
}
div br:nth-last-child(-n+3) {
height: 0;
visibility: hidden;
}
来源:百度AI搜索
|
|
|
|
发表于 2025-7-15 18:42:41
举报
回复
分享
|
|
|
|