Remove padding from item

Can I make an item with an item-thumbnail-left have no padding?

I tried adding padding=“false” and the class=“no-padding” but it didn’t create tight lil’ list items like I want.

1 Like

How does this work for you? Just got to make sure you’re targeting the right class in css

1 Like

Try this:

css file:

.no-padding {
    padding: 0px !important;

html file, add the class “no-padding” to your div or item:

<a class="item no-padding">
. . .

Worked thanks! more to come :o)

Is there a reason this isn’t part of the base css? It seems like a commonly needed feature.

1 Like

I’ve solved the same way you did!

The funny thing is that there is already a style within Ionic which does exactly this, it’s called: “row-no-padding”.

This is meant for usage within grids (row/column), however the funny thing is that “row-no-padding” works anywhere, not just within a grid.

This may not exactly look intuitive or semantic in your template markup, but it works.

1 Like

I understood that I need to add .np-padding {} in css file but can you please help me to understand second part.
In html currently my code is as below , should I write <ion-item class=…

just add no-padding inside item tag like this <item no-padding></item>

Probably because the only thing it does is add styling as far as I know.