javascript 如何去除离子中离子行和离子列的空间(边距/填充)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47671659/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 07:32:36  来源:igfitidea点击:

How to remove space (margin/padding) of ion-row and ion-col in ionic?

javascriptcssangularionic-framework

提问by Ram Guiao

Here is my code:

这是我的代码:

<ion-content padding text-center>
    <img src="../assets/img/logo.png" width="200" class="logo" />


</ion-content>
<ion-footer>
    <ion-row no-padding>
        <ion-col col-6 align-self-stretch>
            <button ion-button full>Button</button>
        </ion-col>
        <ion-col col-6 align-self-stretch>
            <button ion-button full>Button</button>
        </ion-col>
    </ion-row>
</ion-footer>

I need to remove those paddings/margin for ion-row and ion-col. I tried googling but i got no luck. I am also newbie in Ionic. TIA!

我需要删除 ion-row 和 ion-col 的那些填充/边距。我试过谷歌搜索,但我没有运气。我也是 Ionic 的新手。蒂亚!

Here is the screenshot:

这是屏幕截图:

enter image description here

在此处输入图片说明

I need to achieve this:

我需要实现这一目标:

enter image description here

在此处输入图片说明

回答by 99tharun

You need to set the no-paddingattribute on ion-col instead of ion-row and no-marginfor the buttons.

您需要no-padding在 ion-col 而不是 ion-row 和no-margin按钮上设置属性。

<ion-row>
    <ion-col col-6 no-padding>
        <button ion-button full no-margin>Button</button>
    </ion-col>
    <ion-col col-6 no-padding>
        <button ion-button full no-margin>Button</button>
    </ion-col>
</ion-row>