I would like an HTML embed element to become a div block (a specific class), according to a CMS collection filed.
For example, I created the “Special div 1” class, as you can see here:
I also created a CMS collection field called “my special div” where I wrote “Special div 1”.
Then, I created an HTML embed element this way:
Of course, I would like it to become a “my special div” div, but it doesn’t work.
I would like to know what I’m doing wrong, please.
Thank you for your help!
You’re not missing anything, that’s expected.
The Custom Code Embed component is a div in itself, and what you type in will be inside of that div. Always. That’s how Webflow works and you’ll have to deal with this, and find a solution while dealing with this.
@vincent Thank you, Vincent.
I understand your point.
To solve my problem, what should I do to apply a class (Special div 1, Special div 2, etc.) to a div block depending on the “My special div” CMS collection field?
Thank you for your answer.