# Styling issues with a form on a webpage

**URL:** <https://community.hubspot.com/t/styling-issues-with-a-form-on-a-webpage/18145>\
**Category:** CMS Development\
**Tags:** design-manager, css, forms\
**Created:** [January 16, 2020, 10:21am UTC](https://community.hubspot.com/t/styling-issues-with-a-form-on-a-webpage/18145 "2020-01-16T10:21:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![christhomas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/christhomas/32/14727_2.png) [@christhomas](https://community.hubspot.com/u/christhomas)\
**Post date:** [January 16, 2020, 10:21am UTC](https://community.hubspot.com/t/styling-issues-with-a-form-on-a-webpage/18145/1 "2020-01-16T10:21:54Z")

</div>

I’ve created an website page in the HubSpot Template, HubStrap Lite. I’ve tried to add a form to this page however I haven’t been able to target the form and edit to the CSS so that it displays correctly. I’d like the form to be centred, much smaller and with smaller gaps between each section of the form but I can’t edit it. This is a page that highlights the issue with the form: [https://www.oneupcoworking.com/?hs\_preview=KgFVFQof-24452293028](https://www.oneupcoworking.com/?hs_preview=KgFVFQof-24452293028)

Any suggestions on how I would be able to style the form?

Thanks,

Chris

---

<div class="post-metadata">

**Author:** ![Kevin-C](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kevin-c/32/34570_2.png) [@Kevin-C](https://community.hubspot.com/u/Kevin-C)\
**Post date:** [January 17, 2020, 9:04pm UTC](https://community.hubspot.com/t/styling-issues-with-a-form-on-a-webpage/18145/2 "2020-01-17T21:04:06Z")

</div>

Hey @christhomas

So there is a lot going on here!

On one of the HS layout modules a font-size of 100px has been applied.

![Screeenshot - 2020-01-17 at 3.45.34 PM.png](https://d2qpr2jzcazej7.cloudfront.net/optimized/3X/b/e/be4091cec0aee5dd144fdf84cecfee292e3312d0_2_690x39.png)

This combined with the line-height property, inherited from the body tag adds up to some aggressively tall elements (I’m not a fan of applying line-height on the body tag I prefer BEM style css application).

So we remove that and it’ll look like this:

 ![Screeenshot - 2020-01-17 at 3.53.46 PM.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/d/0d6e3ebd1d185f3d2b42d184b005033530126848.jpeg)

To center this I would advise you use the drag and drop template editor as it would be the easiest and wouldn’t require any css to be overriden.

**EDIT:**

These IDs might be dynamic, so the solution below might not be viable.

But you could and some css like so:

```auto
form#hsForm_c3016f0f-6ce5-4ba8-8d18-a63ccb17e242_2091 {
 width: 100%; /* make the form fluid */
 max-width: 500px; /* change max width here */
 margin: auto; /* center it */
}

form#hsForm_c3016f0f-6ce5-4ba8-8d18-a63ccb17e242_2091 input[type="email"],
form#hsForm_c3016f0f-6ce5-4ba8-8d18-a63ccb17e242_2091 input[type="text"] {
 width: 100%; /* set width to prevent overflow */
}

```

Now it looks like this:

 ![Screeenshot - 2020-01-17 at 4.03.24 PM.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/e/ee268ea4bb45370e355174fc4b6c45dcfbabf887.jpeg)

Now to your trouble targeting the form:

This might be due to the very specific CSS that is applied via an inline style tag. So you’d have to try to get more specific to style these elements any further. This code CSS looks like this:

```auto
#hs_cos_wrapper_widget_24452293032 { display: block !important; opacity: 1 !important }
#hs_cos_wrapper_widget_24452293032 input[type="text"] { background-color: #FFFFFF !important; background-image: none !important; border-color: #000000 !important; border-radius: 115px !important; border-style: solid !important; color: #000000 !important; font-size: 50px !important; text-align: center !important }
#hs_cos_wrapper_widget_24452293032 input[type="email"] { background-color: #FFFFFF !important; background-image: none !important; border-color: #000000 !important; border-radius: 115px !important; border-style: solid !important; color: #000000 !important; font-size: 50px !important; text-align: center !important }
#hs_cos_wrapper_widget_24452293032 textarea { background-color: #FFFFFF !important; background-image: none !important; border-color: #000000 !important; border-radius: 115px !important; border-style: solid !important; color: #000000 !important; font-size: 50px !important; text-align: center !important }
#hs_cos_wrapper_widget_24452293032 input[type="number"] { background-color: #FFFFFF !important; background-image: none !important; border-color: #000000 !important; border-radius: 115px !important; border-style: solid !important; color: #000000 !important; font-size: 50px !important; text-align: center !important }
#hs_cos_wrapper_widget_24452293032 select { background-color: #FFFFFF !important; background-image: none !important; border-color: #000000 !important; border-radius: 115px !important; border-style: solid !important; color: #000000 !important; font-size: 50px !important; text-align: center !important }
#hs_cos_wrapper_widget_24452293032 input[type="file"] { background-color: #FFFFFF !important; background-image: none !important; border-color: #000000 !important; border-radius: 115px !important; border-style: solid !important; color: #000000 !important; font-size: 50px !important; text-align: center !important }
#hs_cos_wrapper_widget_24452293032 input[type="tel"] { background-color: #FFFFFF !important; background-image: none !important; border-color: #000000 !important; border-radius: 115px !important; border-style: solid !important; color: #000000 !important; font-size: 50px !important; text-align: center !important }
#hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) { color: #000000 !important; font-size: 50px !important }
#hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) p , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) li , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) span , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) label , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) h1 , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) h2 , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) h3 , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) h4 , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) h5 , #hs_cos_wrapper_widget_24452293032 label:not(.hs-error-msg) h6 { color: #000000 !important; font-size: 50px !important }

```

Now I’m not sure but this CSS maybe coming from the form editor. You could select to have the form be output unstyled and then styling would be a lot easier.

Hope this helps get you moving!
