- This topic is empty.
-
AuthorPosts
-
June 10, 2013 at 10:02 am #45428jameswooMember
Hi,
new here. Hope to get some help with spacing within a list.The list on this website http://legalwillsmalaysia.com/ (the one with blue checks & red crosses) have a spacing between each bullet point that is too large & I can’t figure how to reduce this spacing. The normal list that comes after that are spaced nicely.
Here’s the CodePen. Hope I got this right too http://cdpn.io/gvkso
Any help much appreciated. Tq
June 10, 2013 at 10:08 am #138206David_LeitchParticipantTo fix the problem, I just added margin: 0 and list-item: none to the ul tag. Forked [here](http://codepen.io/David_Leitch/pen/JhDco “http://codepen.io/David_Leitch/pen/JhDco”)
June 10, 2013 at 10:18 am #138207Paulie_DMemberSeems like there’s a lot of unnecessary stuff going on in there:
`list-style-image` would seem to be a better option: http://codepen.io/Paulie-D/pen/IqpeA
June 11, 2013 at 1:15 am #138262jameswooMemberPaulie_D
thanks for your suggestion. I used your code & cleared up a bunch of unnecessary stuff. But I still can’t get the line spacing a bit smaller via css.
present code here http://cdpn.io/GlEoc
Using firebug, I found it seem to inherit a bottom margin setting of 23px (1.5em i think) from the elsewhere. I can use
to get result in the first 2 bullet points as an example but when I include at margin-bottom in the css below, it does not work.
.include_list li p {
margin-bottom: 8px;
}Btw, I have to include the
or everything goes wonky on my site.
Thanks. I’m totally noob at this.
June 11, 2013 at 1:24 am #138263chrisburtonParticipantYou need to remove the `p` tags from your list-item. They’re not needed.
http://codepen.io/seraphzz/pen/ucGBo
> or everything goes wonky on my site
You’re probably making a mistake somewhere. Would help if you updated your code with what I have and then we can fix the issues.
June 11, 2013 at 1:50 am #138266rawat3209ParticipantHey you can fix or adjust the spacing with the line-height property
June 11, 2013 at 2:34 am #138277chrisburtonParticipant@rawat3209 Keep in mind that’s not what line-height is for. He will run into problems when text enters a new line. Margin or Padding is best.
Confusing: http://codepen.io/seraphzz/pen/mCazo
Optimal: http://codepen.io/seraphzz/pen/htecD
June 11, 2013 at 3:17 am #138280jameswooMemberthanks, your code worked great. I reckon the p tag got inherited from the main stylesheet with a margin-bottom of 1.5em. Thanks a lot for everyone chipping in.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.