Code

Calculate Div Width via CMS

Calculate the width of a div using percentages from two numbers in a collection CMS list in Webflow.

Calculate Div Width via CMS preview

Calculate the width of a div using percentages from two numbers in a collection CMS list in Webflow.

How to add it

  1. Add CSS via HTML embed or head section of custom code settings

The code

CSS
                      <!-- Add via HTML embed or head custom code section -->
<style>

.your-class {width:calc(AddYourFirstNumberHere / AddYourSecondNumberHere * 100%);}

</style>

                    

Browse similar code snippets

Language

More from Timothy Ricks

Profile →

Related Webflow questions

All answers →

Similar code snippets

All code snippets →