Find answers, ask questions, and connect with our
community around the world.

Activity Forums Web Design WordPress How to reduce the vertical space above and below a ul list uniformly with one command?

  • How to reduce the vertical space above and below a ul list uniformly with one command?

    updated 2 weeks, 3 days ago 0 Member · 1 Post
  • Deborah

    Member
    October 26, 2019 at 9:32 am

    PROBLEM: How to reduce the vertical space above and below a ul list without having to define different classes according to the objects before and after the list? That is, is it possibile to reduce the space of a fixed quantity using only one class regardless of the objects above and below the list? This is the default vertical spacing in a wordpress list (code on left, output on right) https://i.redd.it/ytvdse73bwu31.png I think that the spacing is too much, so I would like to reduce it and I find out that I have to modify the top and bottom margin of the ul list. I experimented a bit and I think the default values for spacing are 1em top and bottom. The strange thing is that when decreasing from 1em to 0em nothing happens, so I had to go negative and find out that a good value is -0.5em https://i.redd.it/auwmgpu3bwu31.gif Then I tried the same but with div instead of text https://i.redd.it/cvz5d4f4bwu31.png This time the vertical space already changes when decreasing from 1em to 0em, so to decrease as much as in the previous case, I had to set a value of 0.5em. By futher decreasing to -0.5em the vertical spacing is reduced too much. https://i.redd.it/ub1b8p05bwu31.gif So in the case of a div before the list and text after the list (and viceversa), two different margin values have to be set in order to have equal spacing above and below https://i.redd.it/79238ri5bwu31.gif And maybe there are other types of objects which needs different margin values. I was hoping I could set globablly the vertical spacing of the list, without having to define different classes and manually set the correct class each time I have to use a list. Am I doing something wrong or is this how the job has to be done? Isn’t there a way to set globally the space and don’t have to worry every time a list has to be used? – by hq overview oshitwaddup1 – –

Reply to: Deborah
Your information:

Cancel
Original Post
0 of 0 posts June 2018
Now