Uzfren Posted October 25, 2023 Posted October 25, 2023 (edited) I want to add an image in the body of a coverpage, however only code can be placed in the Advanced settings of these pages and cannot be placed in the text box. All the code injections I use preload my image and then it disappears when the cover page loads. This is what I've used so far for the insertion of the image. What I want to do is to for an image to be placed between 2 paragraphs in the text body. <div id="custom-container"> <p>First paragraph of text.</p> <img id="custom-image" src="URL_TO_YOUR_IMAGE.jpg" alt="Your Image Alt Text"> <p>Second paragraph of text.</p> </div> <script> // Get references to the container and the image var container = document.getElementById("custom-container"); var image = document.getElementById("custom-image"); // Create a new paragraph element for text var newParagraph = document.createElement("p"); newParagraph.textContent = "This is a dynamically added paragraph."; // Insert the new paragraph after the image container.insertBefore(newParagraph, image.nextSibling); </script> Edited October 25, 2023 by Uzfren
tuanphan Posted October 27, 2023 Posted October 27, 2023 Hi, Can you share link to cover page? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment