Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的项目中使用基于模板的模态,默认情况下模态位置在页面的中间。而不是这个,我想在顶部显示模态。
模态定义为“位置:绝对”(或“固定”),因此在“x”和“y”中也有一个位置。您可以更改此位置,在这种情况下,在您的 css 中的“x”(顶部或底部)中。例子:
.modal {position: absolute; top: 0}
或者
.modal {position: fixed; top: 0}