# 하위 카테고리에 이미지를 추가하고 크기를 조정하는 방법은 무엇인가요?

**URL:** https://meta.discourse.org/t/how-can-i-add-an-image-to-a-subcategory-and-sizing-that-image/304621
**Category:** Development
**Tags:** css
**Created:** [4월 19, 2024, 1:04오후 UTC](https://meta.discourse.org/t/how-can-i-add-an-image-to-a-subcategory-and-sizing-that-image/304621 "2024-04-19T13:04:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ogulcan1787](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ogulcan1787/32/128589_2.png) [@ogulcan1787](https://meta.discourse.org/u/ogulcan1787)
#### Post date: [4월 19, 2024, 1:04오후 UTC](https://meta.discourse.org/t/how-can-i-add-an-image-to-a-subcategory-and-sizing-that-image/304621/1 "2024-04-19T13:04:33Z")

</div>

안녕하세요,

::before CSS 코드를 수정하여 background: none을 사용하고 background-image: url (…)를 추가했습니다.  
하지만 크기를 조절할 때 원하는 대로 작동하지 않습니다.

예를 들어 width: 60px, height: 60px 또는 max-width: 60px를 적용했을 때 말이죠.

어디서 실수를 하고 있을까요?

---

<div class="post-metadata">

### Author: ![ogulcan1787](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ogulcan1787/32/128589_2.png) [@ogulcan1787](https://meta.discourse.org/u/ogulcan1787)
#### Post date: [4월 19, 2024, 1:28오후 UTC](https://meta.discourse.org/t/how-can-i-add-an-image-to-a-subcategory-and-sizing-that-image/304621/2 "2024-04-19T13:28:55Z")

</div>

제가 이렇게 했습니다 🙂

```plaintext
.badge-category__wrapper .badge-category:before {
    background: none;
    border-radius: 2px;
    margin-top: 4px;
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    background-image: url(IMG URL);
    background-size: 15px 15px;
    margin-right: .5em;
}

.badge-category__wrapper .badge-category.--has-parent:before {
    background: none;
    border-radius: 2px;
    margin-top: 4px;
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    background-image: url(IMG URL);
    background-size: 15px 15px;
    margin-right: .5em;
}

```
