Code to fix embed issue with webflow

I think webflow is possibly the slickest responsive website builder out there right now. There is an issue with how it interprets Knack's embeds though. After a bit of hair-pulling I figured out that it has to do with Knack not automatically clearing after each view render. Rather than enter every single view selector into the webflow css editor you can use this simple script. Hope it helps someone.

 


$(document).on('knack-view-render.any', function(event, view, data) {
var key = view.key;
var selector = '#' + key;
//console.log("selector key : " + selector);

//console.log("view Key:" + key);
$(selector).css('clear', 'both');

});

Hi Justin - Are you entering anything on Webflow side so Knack can inherit the CSS?

Everytime I add the embed code it doesn't inherit my webflow css

It picks up the CSS.

Hi Justin,

I am new to website building but Webflow does look very slick and miles ahead of the others that I have looked at.

It seems you have to be on a paid plan to use embeds so could you tell me if the content in the Knack App take styling from Webflow or does it behave like Wix where no styles transfer to the app?

Thanks