• Resolved julien2400056

    (@julien2400056)


    Hi everyone,

    I’ll make this quick:

    I want to add a timeline to my homepage, I don’t use a page builder except Gutenberg so I decided to code it myself with the little knowledge I have.

    Here is what I did with the W3 code editor:

    The expected result

    Here is what I did:

    • Simply copied and pasted the HTML code in the Custom HTML block
    • Simply copied and pasted the CSS via the settings.

    Here is the result :

    I added the code between two sections, and the one below disappeared in addition to the fact that the style is broken.

    Seeing that it didn’t work, I then inserted the CSS inside the custom HTML block itself, but the result is the same.

    I saw a topic like this here but it didn’t quite answer my problem, I think I’m missing something classic but I’m a beginner…

    Any idea what the problem is?

    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Placing CSS into custom HTML blocks will subject it to corruption by editor processes like wpautop(). Any additional CSS should be placed in the customizer’s Additional CSS section. Your page’s body tag typically has some unique classes you can use to cause your CSS to only be applied to a single page, if that’s what you want.

    Only place HTML in the WP editor. Any other code belongs elsewhere. However, if non-HTML code absolutely needs to be within post content for some reason, it can be safely injected via a custom shortcode.

    Thread Starter julien2400056

    (@julien2400056)

    Thank you bcworkz for your return,

    I replaced CSS and HTML properly.

    I notice that there is some customizations to do evenf if the render is great on a code editor. In fact I had to play with the CSS to recreate the expected result that I had on the code editor.

    Thank you again for your precisions ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom HTML and CSS Not Rendering’ is closed to new replies.