# How to set a fixed css value to a Dynatrace component

**URL:** <https://community.dynatrace.com/t/how-to-set-a-fixed-css-value-to-a-dynatrace-component/41371>\
**Category:** Developer Q&A Forum\
**Tags:** custom-app\
**Created:** [August 25, 2023, 3:12pm UTC](https://community.dynatrace.com/t/how-to-set-a-fixed-css-value-to-a-dynatrace-component/41371 "2023-08-25T15:12:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoyLi](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@JoyLi](https://community.dynatrace.com/u/JoyLi)\
**Post date:** [August 25, 2023, 3:12pm UTC](https://community.dynatrace.com/t/how-to-set-a-fixed-css-value-to-a-dynatrace-component/41371/1 "2023-08-25T15:12:53Z")

</div>

Hi,

I am figuring out how to set a fixed with to Formfiled component and TextInput. I tried to wrap these to components into a div but it failed. Could you help to expalin how to adapt a normal css stve to Dynatrace components. Thanks.

Now my code looks like this:

\<div style={{ width: ‘100’ }}\>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<FormField &nbsp;required\>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<TextInput&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;…&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /\>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \</FormField\>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \</div\>

---

<div class="post-metadata">

**Author:** ![SarahRiener](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@SarahRiener](https://community.dynatrace.com/u/SarahRiener)\
**Post date:** [August 28, 2023, 7:29am UTC](https://community.dynatrace.com/t/how-to-set-a-fixed-css-value-to-a-dynatrace-component/41371/2 "2023-08-28T07:29:54Z")

</div>

Hi&nbsp;[@JoyLi](https://community.dynatrace.com/user/66075)&nbsp;,

may I ask which version of the&nbsp;@dynatrace/strato-components-preview package you’re using?

Here is an example that works for me:

```markup
<Grid width="350px">
        <FormField label="Enter text" required>
          <TextInput placeholder="This is a default text input" />
        </FormField>
      </Grid>

```

The width prop can be adapted to your needs, e.g. to “100%” or “100px”. I hope that helps!

Best regards,

Sarah
