我在 xamarin 表单中使用 css 样式。我有网格 wirh 按钮:
StackLayout {
background-color: #1e1e1e;
color: #ffffff;
}
Button{
background-color: #2d2d30;
font-family: Consolas;
font-size: 24;
margin: 0;
}
和xaml:
<Grid>
<Grid.ColumnDefinitions>
/*...*/
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
/*...*/
</Grid.RowDefinitions>
<Button/>
<Button/>
/*...*/
</Grid>
如何消除按钮之间的间隙?
最佳答案
这是行内 block 元素问题。如您所见:
button {
width: 50px;
height: 50px;
background: #000;
outline:none;
border:none;
margin:0;
}
<button></button>
<button></button>
<button></button>
我们可以使用这两种方法来消除间隙。
- 相邻写
button {
width: 50px;
height: 50px;
background: #000;
outline:none;
border:none;
}
<button></button><button></button><button></button>
- 评论行
button {
width: 50px;
height: 50px;
background: #000;
outline:none;
border:none;
}
<button></button><!--
--><button></button><!--
--><button></button>
关于c# - xamarin 中的网格样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58580256/