# Change CSS in Search Bar??

**URL:** <https://community.hubspot.com/t/change-css-in-search-bar/20647>\
**Category:** CMS Development\
**Tags:** css\
**Created:** [May 6, 2020, 4:09pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647 "2020-05-06T16:09:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![grega](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grega/32/81360_2.png) [@grega](https://community.hubspot.com/u/grega)\
**Post date:** [May 6, 2020, 4:09pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647/1 "2020-05-06T16:09:26Z")

</div>

![Screen Shot 2020-05-06 at 11.06.03 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/e/9ed59ec5ec6a945f931e20417f80e34a19e2c176.png)  
I created a search bar template easily enough but as you can see, but now I have to change the text color of the search results from blue to white. How do I change the CSS for this template. The attached CSS used on other pages does not do it.

---

<div class="post-metadata">

**Author:** ![psdtohubspot](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/psdtohubspot/32/70262_2.png) [@psdtohubspot](https://community.hubspot.com/u/psdtohubspot)\
**Post date:** [May 6, 2020, 8:42pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647/2 "2020-05-06T20:42:07Z")

</div>

Hi @grega  
Please add below code inside your Page stylesheet sheet easily you can find in your template :

> **[Create, edit, and attach CSS files to style your site](https://knowledge.hubspot.com/design-manager/create-edit-and-attach-css-files-to-style-your-site)**
>
> This article walks through creating, publishing, and attaching a CSS file in HubSpot.

Just **Paste**

```auto
ul.hs-search-field __suggestions { background: #ffffff; padding: 10px 10px;}ul.hs-search-field__ suggestions>li>a {
 color: #000;
 text-decoration: none;
}

```

Result/ Output-

🙂

 ![search-bar.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/2/02cd8d858f64dfd1bbb526ddbc95f8d7fd6738c2.png)

Please Accept this Solution I am sure it will work  
Thanks!  
Ajit

---

<div class="post-metadata">

**Author:** ![grega](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grega/32/81360_2.png) [@grega](https://community.hubspot.com/u/grega)\
**Post date:** [May 7, 2020, 12:51pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647/3 "2020-05-07T12:51:11Z")

</div>

Unfortunatly it does not work. Unless I’m adding it to the wrong place.

Thanks

---

<div class="post-metadata">

**Author:** ![grega](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grega/32/81360_2.png) [@grega](https://community.hubspot.com/u/grega)\
**Post date:** [May 7, 2020, 1:20pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647/4 "2020-05-07T13:20:47Z")

</div>

I added it here and nothing changes.

 ![Screen Shot 2020-05-07 at 8.19.28 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/c/ca2407be57bf0131e1608477d396836df5f98658.png)

---

<div class="post-metadata">

**Author:** ![grega](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grega/32/81360_2.png) [@grega](https://community.hubspot.com/u/grega)\
**Post date:** [May 7, 2020, 3:31pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647/5 "2020-05-07T15:31:48Z")

</div>

Ajit:

I was wrong. The code works. THANKS.

Are you able to tell me why I have two search boxes now though?

![Screen Shot 2020-05-07 at 10.28.49 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/8/f8f6f2e21cd3e838d061ad1e351577fd0803f085.png)

---

<div class="post-metadata">

**Author:** ![psdtohubspot](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/psdtohubspot/32/70262_2.png) [@psdtohubspot](https://community.hubspot.com/u/psdtohubspot)\
**Post date:** [May 7, 2020, 7:30pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647/6 "2020-05-07T19:30:00Z")

</div>

Hi @grega  
Please refer my screenshot you have added the wrong CSS  
in your **Style.css**

 ![search-bar.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/4/e445a41999114f6f362d7a7eb079aab05d00e2ce.png)

Add this

```auto
ul.hs-search-field__suggestions {
 background: #fff;
 padding: 10px 10px;
}

ul.hs-search-field__suggestions li>a{
 color:#000;
 text-decoration:none;
}

```

And One more important issue you haven’t created Result Page

> **[Set up a results page to use a search field on your site](https://knowledge.hubspot.com/design-manager/set-up-a-results-page-to-use-a-search-field-on-your-site)**
>
> Learn how to add a search field to your HubSpot pages with a search results page system template.

Look Example here by using search field: [PSDtoHUBSPOT | Creative Blog](http://psdtohubspot-2432204.hs-sites.com/creative-blog)  
Search Result: [high-search](http://psdtohubspot-2432204.hs-sites.com/hs-search-results?term=hubspot)  
Please follow the above Guide LInes and I will suggest reducing the site-search input  
By 50%. Looks very odd

 ![Screenshot_4.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/7/d7d03c03f1a970e0f343fa6661e16e29abf6face.png)

Let me know if my help needed in coding.  
Thanks!  
Ajit  
[support@psdtohubspot.com](mailto:support@psdtohubspot.com)

---

<div class="post-metadata">

**Author:** ![grega](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grega/32/81360_2.png) [@grega](https://community.hubspot.com/u/grega)\
**Post date:** [May 11, 2020, 12:39pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647/7 "2020-05-11T12:39:28Z")

</div>

Thank you for all the help.

You suggest reducing sitre search input by 50%. Where do I go to change the size?

Thanks,

Greg

---

<div class="post-metadata">

**Author:** ![psdtohubspot](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/psdtohubspot/32/70262_2.png) [@psdtohubspot](https://community.hubspot.com/u/psdtohubspot)\
**Post date:** [May 11, 2020, 8:38pm UTC](https://community.hubspot.com/t/change-css-in-search-bar/20647/8 "2020-05-11T20:38:31Z")

</div>

Hi @grega  
Really Happy My Solution helped for your website,  
Please Copy & Paste this below code inside your stylesheet.

```auto
.hs-search-field {
 position: relative;
 max-width: 400px;
 float: right;
 width: 100%;
 margin-bottom: 10px;
}

input.hs-search-field__input {
 height: 50px;
 padding-left: 16px;
 font-size: 14px;
}

.hs-search-field--open .hs-search-field__suggestions {
 border: 1px solid #000;
 padding: 10px;
}

```

**Output :**

 ![Screenshot_5.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/a/7a4c2e28fdfe409830b235cf43b615fcc8c6aed6.png)

If this helps please **Accept My Solution**

Happy to Help 🙂  
Thanks!  
Ajit
