Archived topic
Adding Margin Top-Bottom to LAYOUT ELEMENTS
3 replies · Started by John on December 20, 2021
Hello again!
How can I add margin top/bottom above/below the entry content of a LAYOUT ELEMENT?
I only want it for specific pages which have that layout.
For example:
https://wordpress-681983-2245781.cloudwaysapps.com/anxiety-fatigue-the-trump-years-and-finding-resilience-in-your-body/
This page needs margin/padding above the Title.
Also the same at the bottom of the content.
I do not want to apply CSS to the whole site as it messes with the design of the other pages.
Is it possible to give a LAYOUT ELEMENT a custom class or soemthign like that?
Many thanks!
Hi John,
I'm not sure I understood what you mean.
Layout Elements don't add/create contents as it can only change the layout of a page.
If you want a conditional CSS that matches the same condition as the Layout Element, you can create a Hook element containing the CSS styles you want for it and just copy the Display rule of the Layout element.
Example: adding a padding top and bottom to article of the page.
Add this code to the code area of the Hook element:
<style id="hook-element-styling">
.inside-article {
padding: 40px 0px !important;
}
</style>
and then copy the display rule location of the layout element to this hook element
OK yes - that explains it perfectly thank you.
Does it work for you? Let us know if you need further help. :D