Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1248999

    Smarticle
    Participant

    What code is required to remove the default padding at the bottom of standard Text (the Text Element).

    I only want to do this on specific pages and only on specific parts of the page… so I need to do it by Class, if possible. I’m happy to put the code in the global Customiser though.

    I don’t want to remove all paragraph padding, obviously… hence only wanting to apply it to specific (Text) Elements.

    My ultimate aim is to centralise the text perfectly within a section (the equivalent of using the “man” class on Custom Headlines), so the height (of the Section) above and below the body of text is exactly the same. I often use float:none;display:inline-block;vertical-align:middle; if I’m using more than one column with various Elements I want sitting perfectly central within a row. Text is the only thing that currently mucks it up.

    #1249011

    Thai
    Moderator

    Hi There,

    Please add the following CSS:

    .x-text p {
    margin-bottom: 0;
    }

    Hope it helps 🙂

    #1249027

    Smarticle
    Participant

    Think I’ve found it/worked it out…

    Gave the Text Element a class of no-pad, then added this to the page’s Custom CSS:

    .no-pad p:last-child {
    margin-bottom: 0;
    }

    Is that the best solution?

    I presume I can take out the :last-child part (see below) if I don’t mind it affecting the rest of the gaps between paragraphs, right?

    .no-pad p {
    margin-bottom: 0;
    }

    #1249175

    Joao
    Moderator

    Hi There,

    Yes, that looks correct.

    Let us know if you need further help,

    Joao