【问题标题】:how to align html dialog left or right with Firefox?如何将 html 对话框与 Firefox 左对齐或右对齐?
【发布时间】:2019-12-31 13:56:54
【问题描述】:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog 我与 Firefox 中的 html 对话框元素有些冲突。 我想将对话框左/右对齐,不知道如何正确操作。

默认居中 我的解决方法是定位父元素

<div style="position:fixed;right:0;width:10cm;">
  <dialog id="dlg" open>bla bla</dialog>
</div>

【问题讨论】:

    标签: html firefox dialog


    【解决方案1】:

    似乎工作正常。我以为它不是block element,但我似乎错了,因为它在 Chrome 和 FX 中显示相同

    dialog {width:10cm;}
    
    #dlg1 {position:fixed;top:75px; right:0}
    #dlg2 {position:fixed;top:143px; right:0}
    <div style="position:fixed;right:0;width:100%">
      <dialog id="dlg" open>bla bla</dialog>
    </div>
    
    <dialog id="dlg1" open>bla bla</dialog>
    
    <dialog id="dlg2" open>bla bla</dialog>

    【讨论】:

      猜你喜欢
      • 2021-02-21
      • 1970-01-01
      • 2012-02-24
      • 2012-10-30
      • 1970-01-01
      • 1970-01-01
      • 2014-12-17
      • 1970-01-01
      • 2018-01-24
      相关资源
      最近更新 更多