[GH-ISSUE #423] Empty spaces when using flag as background-image with specific width and height #261

Closed
opened 2026-03-03 14:35:53 +03:00 by kerem · 5 comments
Owner

Originally created by @Humeira on GitHub (Jan 24, 2018).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/423

Hello,

I wanted to add a shadow on the flag, but unfortunately it's not pleasant on the eye because of the spaces as shown in the screenshot below.

I just drop in the classes flag-icon flag-icon-us flag-custom on the div with the following CSS only specifying the width and the height

.flag-custom { width: 85px; height: 85px }

Is there anyway to remove these spaces?

image

Originally created by @Humeira on GitHub (Jan 24, 2018). Original GitHub issue: https://github.com/lipis/flag-icons/issues/423 Hello, I wanted to add a shadow on the flag, but unfortunately it's not pleasant on the eye because of the spaces as shown in the screenshot below. I just drop in the classes `flag-icon flag-icon-us flag-custom` on the div with the following CSS only specifying the width and the height `.flag-custom { width: 85px; height: 85px }` Is there anyway to remove these spaces? ![image](https://user-images.githubusercontent.com/3885848/35317017-1cdb5336-00ee-11e8-9cad-57afeaa4556f.png)
kerem closed this issue 2026-03-03 14:35:53 +03:00
Author
Owner

@lipis commented on GitHub (Jan 24, 2018):

are you using the squared version?

<!-- gh-comment-id:360099199 --> @lipis commented on GitHub (Jan 24, 2018): are you using the squared version?
Author
Owner

@Humeira commented on GitHub (Jan 24, 2018):

@lipis nope only flag-icon flag-icon-us and my custom width & height

<!-- gh-comment-id:360105625 --> @Humeira commented on GitHub (Jan 24, 2018): @lipis nope only `flag-icon flag-icon-us` and my custom width & height
Author
Owner

@Findus23 commented on GitHub (Jan 24, 2018):

But when you are using non-square flags and forcing them to be square via CSS there is no other way than adding spacing at the top.
To have a aspect ratio of 4:3 you'll need to use a height of 63.75px.

<!-- gh-comment-id:360176755 --> @Findus23 commented on GitHub (Jan 24, 2018): But when you are using non-square flags and forcing them to be square via CSS there is no other way than adding spacing at the top. To have a aspect ratio of 4:3 you'll need to use a height of `63.75px`.
Author
Owner

@lipis commented on GitHub (Jan 24, 2018):

and instead of flag-icon you can use the flag-icon-background and flag-icon-squared but maybe some overrides need to be done.. haven't played with squared background ones :)

<!-- gh-comment-id:360197053 --> @lipis commented on GitHub (Jan 24, 2018): and instead of `flag-icon` you can use the `flag-icon-background` and `flag-icon-squared` but maybe some overrides need to be done.. haven't played with squared background ones :)
Author
Owner

@Humeira commented on GitHub (Jan 26, 2018):

@lipis thanks i'll try that.

<!-- gh-comment-id:360865464 --> @Humeira commented on GitHub (Jan 26, 2018): @lipis thanks i'll try that.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#261
No description provided.