Solved

CSS Margin on <ul>

Posted on 2014-01-15
2
308 Views
Last Modified: 2014-01-16
Can I change the vertical spacing on the HTML <ul> element with the margin property, applied to <ul>?

For example. please look at https://www.whasocal.org/sponsor_benefitst.php.

Note the large amount of white space between the prior text & the start of the <li> items in several places.

If this can't be done with margin on <ul>, how can I do it?

Thanks
0
Comment
Question by:Richard Korts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39784274
Add to UL {}
margin:0

For the P tag remove the margins (why the negative margin?) and add

margin: 1em 0 .6em 0;

Just tweak the margin as you need.
0
 
LVL 5

Expert Comment

by:Neil_Bradley
ID: 39784375
You could use "last-child" to target the last li tag in your list.
For example
li:last-child{padding-bottom:20px}

Open in new window

This will put a nice block of padding under each of your lists and tidy up your spacing a bit..
Cheers,
Neil
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question