1、
document.querySelector("section article .css-1dbjc4n div > div[role='group']").scrollIntoViewIfNeeded() 元素將在其所在滾動區的可視區域中居中對齊 好用

document.querySelector("section article .css-1dbjc4n div > div[role='group']").scrollIntoViewIfNeeded(false)
則元素將與其所在滾動區的可視區域最近的邊緣對齊。 根據可見區域最靠近元素的哪個邊緣,元素的頂部將與可見區域的頂部邊緣對准,或者元素的底部邊緣將與可見區域的底部邊緣對准
鏈接:https://developer.mozilla.org/zh-CN/docs/Web/API/Element/scrollIntoView 示例: var element = document.getElementById("box"); element.scrollIntoView(); 元素的頂端將和其所在滾動區的可視區域的頂端對齊 element.scrollIntoView(false); 元素的底端將和其所在滾動區的可視區域的底端對齊 element.scrollIntoView({block: "end"}); element.scrollIntoView({behavior: "instant", block: "end", inline: "nearest"});