Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CSS Margin on <ul>

Posted on 2014-01-15
2
Medium Priority
?
326 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

604 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