# I want to change css flex variable based on variable number

**URL:** <https://community.hubspot.com/t/i-want-to-change-css-flex-variable-based-on-variable-number/75666>\
**Category:** CMS Development\
**Tags:** css\
**Created:** [February 21, 2023, 6:10pm UTC](https://community.hubspot.com/t/i-want-to-change-css-flex-variable-based-on-variable-number/75666 "2023-02-21T18:10:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IMckell](https://avatars.discourse-cdn.com/v4/letter/i/3ec8ea/32.png) [@IMckell](https://community.hubspot.com/u/IMckell)\
**Post date:** [February 21, 2023, 6:10pm UTC](https://community.hubspot.com/t/i-want-to-change-css-flex-variable-based-on-variable-number/75666/1 "2023-02-21T18:10:04Z")

</div>

So I’m making a module, in that module I have an image and some text that are side by side using flexbox. I want people to be able to manipulate a module variable “center” to control the flex property between the two items. This is my code.

\<style\>  
\* {  
box-sizing: border-box;  
}

.module-container3{  
margin: 5px;  
max-width: 100%;  
}

.module-container3 .side-by-side{  
display: flex;  
flex-wrap: wrap;  
}

.module-container3 .side-by-side .image{

flex: {{ module.center }};

margin: auto;  
width: auto;  
min-width: 100px;  
}

.module-container3 .side-by-side .text{

flex: calc(100% - {{ module.center }});

padding: 0px 10px 15px 40px;  
vertical-align: middle;  
line-height: 1.5;  
}

\</style\>

I put this code in the html file so that the hubl variables should work, but it’s not. Any tips on how to set the flex property based on module variables?

---

<div class="post-metadata">

**Author:** ![hgibson2](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@hgibson2](https://community.hubspot.com/u/hgibson2)\
**Post date:** [February 22, 2023, 9:39am UTC](https://community.hubspot.com/t/i-want-to-change-css-flex-variable-based-on-variable-number/75666/2 "2023-02-22T09:39:20Z")

</div>

Check this out I believe your answer lies in this article. - [https://developer.mozilla.org/en-US/docs/Web/CSS/Using\_CSS\_custom\_properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)

---

<div class="post-metadata">

**Author:** ![hgibson2](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@hgibson2](https://community.hubspot.com/u/hgibson2)\
**Post date:** [February 27, 2023, 5:21am UTC](https://community.hubspot.com/t/i-want-to-change-css-flex-variable-based-on-variable-number/75666/3 "2023-02-27T05:21:59Z")

</div>

If that has not solved your issue here is another, [https://famewide.com/](https://famewide.com/)
