![](/img/trans.png)
[英]Angular Material 2 : How to put a fab button on top of the md-table at the bottom right corner?
[英]How to align button in top right corner inside Dialog angular material?
我想将对话框角材料内右上角的按钮对齐。 问题是我在按钮和对话框的角之间有一些空间,我不想要它。
这是我的html代码:
<button #btnClose mat-button class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
这是我的CSS代码:
.close {
color: black;
opacity: 1;
max-width: 2vw !important;
min-width: 2vw !important;
}
我可以用裕度在CSS中做一些“技巧”,但是我认为这是个坏主意:
.close {
color: black;
opacity: 1;
max-width: 2vw !important;
min-width: 2vw !important;
margin: -1.2vw -1.2vw;
}
然后我得到了我想要的:
有更好的解决方案吗? PS:它必须具有响应能力。
如果要对齐右上角的内容,可以使用:
.close {
position: absolute;
top: 0;
right: 0;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.