我开始做cookies 横幅了.为了尽可能简化我的问题,我在W3School try it编辑器中粘贴了以下内容:
<dialog open style="position:fixed;right:0;">
<button>Decline</button>
<button>Allow cookies</button>
</dialog>
预期结果:它应该位于视区的右侧.实际结果:对话框在视口中居中.
当我将上面的代码编辑为使用div而不是对话框时,它会按预期工作:
<div style="position:fixed;right:0;">
<button>Decline</button>
<button>Allow cookies</button>
</div>
按其应有的方式移至视区的右侧.
如何从HTML5对话框标记中获取此行为?
感谢人们在这里所做的一切出色的工作.