• Resolved Erez Speiser

    (@erezspeiser)


    Hi
    I started to use the plugin yesterday. Supper Amazing!!

    I created a form and added some custom CSS to it.
    On the plugin preview, it works fine.
    Inside Gutenberg, it works fine.
    Inside WordPress customizer it works fine.
    BUT, on the live page, the custom CSS is ignored.
    When I look at the page source I can see the custom CSS printed in the HTML, but when I inspect the elements of the Chrome dev tools, they don’t exist.
    I deactivated the Siteground optimizer and purged cache, but still the same.
    When I copy the custom CSS from the plugin and paste it into the WordPress CSS customizer it does work fine.

    Any clues?
    Thanks!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @erezspeiser

    In the form’s preview, only the styles defined by the plugin affect the form’s fields. However, the public website loads the styles defined by the theme active, and they affect every tag on the page. For this reason, in some cases, it is required to define the CSS rules with the !important; modifier.

    I’ve checked your form, and some styles were defined with incorrect selectors. Please, try replacing your styles block with the following ones:

    
    #fbuilder p.left-name {
    	font-size:1.5em!important;
    }
    #fbuilder .fieldname9_1,
    #fbuilder .fieldname2_1,
    #fbuilder .fieldname1_1,
    #fbuilder .fieldname10_1,
    #fbuilder .fieldname6_1,
    #fbuilder .fieldname7_1,
    #fbuilder .myfield {
    	width:200px!important;
    	text-align:center;
    }
    
    form {
    	width:650px!important;
    }
    
    @media screen and (max-width: 767px) {
    form {
    	width:100%!important;}
    	#fbuilder div.fields {
    		text-align:center!important;
    		margin:auto!important;
    	}
    }
    
    #fbuilder .fields {
    	text-align:center !important;
    }
    
    #fbuilder .fform h2 {display:none !important;}
    #fbuilder .fform{text-align:center;}
    

    Best regards.

    Thread Starter Erez Speiser

    (@erezspeiser)

    Hi
    Thanks for your reply.
    It did not solve the problem.
    As I mentioned in my original post when you check with the inspector of the browser developer tools, you see that the CSS rules don’t apply at all. If they were overwritten they would have appeared with a strikethrough.

    I took the CSS code, deleted it from the CSS box and pasted it enclosed with <style></style> inside an HTML field at the top of the form. Now the CSS work just fine.
    You can have a look here: https://www.machiningdoctor.com/calculators/inch-to-metric/
    And compare it to the original form with the CSS in the normal placement:
    https://www.machiningdoctor.com/cff-css-isue/

    It is not a critical issue, but I prefer to work in the “normal way”

    Many Thanks
    Erez

    Plugin Author codepeople

    (@codepeople)

    Hello @erezspeiser

    If there is a plugin active on your WordPress for optimizing the website and managing the cache, please, check it is not removing the block of styles. About your solution, it is valid.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom CSS not working on frontend’ is closed to new replies.