# Each WordPress block Class attribute adds space to the HTML output when empty

**URL:** <https://forum.pinegrow.com/t/each-wordpress-block-class-attribute-adds-space-to-the-html-output-when-empty/8902>\
**Category:** General\
**Created:** [May 8, 2024, 2:00pm UTC](https://forum.pinegrow.com/t/each-wordpress-block-class-attribute-adds-space-to-the-html-output-when-empty/8902 "2024-05-08T14:00:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krievinshj](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@krievinshj](https://forum.pinegrow.com/u/krievinshj)\
**Post date:** [May 8, 2024, 2:00pm UTC](https://forum.pinegrow.com/t/each-wordpress-block-class-attribute-adds-space-to-the-html-output-when-empty/8902/1 "2024-05-08T14:00:42Z")

</div>

Hi, I am quite new to Pingrow, trying out some different attributes for the Gutenberg block and noticed that if I add a couple of Class attributes as a Select box to add some utility classes but leave them empty when editing the page in WordPress, then each attribute adds a space in the frontend after the existing class, leading to ugly HTML.

It’s worth mentioning that I don’t want a default value, so if a particular attribute option is not selected, then I don’t want class to be added. I tried to use "_none_ " for the default value in hopes this would fix the empty space added, but no.

The idea was to create a custom block, set some default styling for it, but then if needed, I can control some extra styling like padding, background color, etc., via an attributes by adding utility classes. In total, I have 5 Class attributes as Select boxes, and if I leave them all empty (in case I want the default look and no extra class), I get something like this in the frontend:

![Screenshot 2024-05-08 at 16.43.54](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/5/53a22f15b1bd59b384e8bdea95071541f3ad4408.png)

Basically, it adds 5x space because of 5 attributes I have. Of course, I understand the logic that each added class needs space, but when empty (class is not added), then space should also be absent.  
So I’m not sure if I am doing something wrong or if this is some bug. Any idea?

---

<div class="post-metadata">

**Author:** ![tytusie](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/tytusie/32/6914_2.png) [@tytusie](https://forum.pinegrow.com/u/tytusie)\
**Post date:** [May 16, 2024, 10:13am UTC](https://forum.pinegrow.com/t/each-wordpress-block-class-attribute-adds-space-to-the-html-output-when-empty/8902/2 "2024-05-16T10:13:55Z")

</div>

sounds like a bug… @matjaz correct?
