# Trouble with form input fields (updated)

**URL:** <https://community.hubspot.com/t/trouble-with-form-input-fields-updated/51769>\
**Category:** CMS Development\
**Tags:** css, forms\
**Created:** [February 17, 2022, 5:16pm UTC](https://community.hubspot.com/t/trouble-with-form-input-fields-updated/51769 "2022-02-17T17:16:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RVanKammen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rvankammen/32/88924_2.png) [@RVanKammen](https://community.hubspot.com/u/RVanKammen)\
**Post date:** [February 17, 2022, 5:16pm UTC](https://community.hubspot.com/t/trouble-with-form-input-fields-updated/51769/1 "2022-02-17T17:16:00Z")

</div>

Hi everyone!

I am a web designer that is very fresh when it comes to writing custom html and css. Typically my workflow involved handing off a prototype for development, not coding a site or pages myself … until our team joined Hubspot very recently. Now I am in the process of learning how to build my own custom modules using html and css.

I seem to be having trouble with form input fields in my custom module. I’ve been able to apply custom css to the entire form starting with the [cms theme boilerplate](https://github.com/HubSpot/cms-theme-boilerplate/blob/main/src/css/elements/_forms.css). I’ve given my input fields a width of 350px, but displays at 370px. There is 10px of padding (left/right) that I gather makes up that additional 20px.

 ![Screen Shot 2022-02-17 at 11.11.01 AM.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/8/815120fbd9d7500f58851e7256fce76ccf42c4b5.jpeg)  
container width: 350px  
 ![Screen Shot 2022-02-17 at 11.11.15 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/e/ec04bc808a6d94dd1496c709926e01860d40c5c1.png)  
input width: 370px

Why does this happen and how do I style these with the correct widths and padding?

Additionally, when I click into the field the focus state resizes to 350 px (or it’s original size such as the text area at the bottom of the form).

 ![Screen Shot 2022-02-17 at 11.11.32 AM.png](https://d2qpr2jzcazej7.cloudfront.net/original/1X/732e0cc3cf10619f0e968a15e243b0d9b061ae5a.png)

I feel as if I am 90% of the way there and could probably live with the present state, but would like to understand where I am falling short and why.

Here is the url to the custom landing page I am building:

[https://drive.mecum.com/mecum-landing-page](https://drive.mecum.com/mecum-landing-page)

Please bear with me, the module with the hero image and form is not styled for responsiveness - so make sure your browser window is full width. I wanted to get the full module dialed in before moving onto media queries. The rest of the page should be fully responsive.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [February 17, 2022, 7:07pm UTC](https://community.hubspot.com/t/trouble-with-form-input-fields-updated/51769/2 "2022-02-17T19:07:39Z")

</div>

@RVanKammen The reason it shrinks to 350 when you click into an input is because the :focus state has box-sizing: border-box; set on it. So if you add box-sizing: border-box; to the non-focus state this would fix your issue. What **box-sizing: border-box;** basically does is tell the width to include the padding and border.

```lia-code-sample
form textarea,
form select,
form input[type=text],
form input[type=email],
form input[type=password],
form input[type=tel],
form input[type=number],
form input[type=file],
input[type=string] {
 box-sizing: border-box;
 width: 350px;
}

```

---

<div class="post-metadata">

**Author:** ![RVanKammen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rvankammen/32/88924_2.png) [@RVanKammen](https://community.hubspot.com/u/RVanKammen)\
**Post date:** [February 17, 2022, 8:14pm UTC](https://community.hubspot.com/t/trouble-with-form-input-fields-updated/51769/3 "2022-02-17T20:14:03Z")

</div>

Ah!! Knew it had to be something simple that I was missing.

Most of my other issues I’ve been able to troubleshoot pretty well on my own. But couldn’t quite find the solution for this one, so I came to the Community for help 😊

Thank you so much for helping me with this!
