473,545 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to increase vertical spacing between UL or OL items

Hi,

what Property and Values are used to space out further from one
another the items in a list (assuming it's possible)? The default
presentation is a bit "bunched up" for me.

Thanks,
Dave
Jul 20 '05 #1
13 77667
Dave wrote:
what Property and Values are used to space out further from one
another the items in a list (assuming it's possible)? The default
presentation is a bit "bunched up" for me.


I use:

li {
margin-left: 0;
margin-right: 10%;
margin-top: .5em;
margin-bottom: .5em;
}

(The margin-right makes the LIs shorter than the paragraphs
around them which suits my purposes).

You could also try line-height:150% (I think anything over 120%
is larger than most browser defaults).
--
jc

Remove the -not from email
Jul 20 '05 #2
> I use:

li {
margin-left: 0;
margin-right: 10%;
margin-top: .5em;
margin-bottom: .5em;
}


Or...

li {margin:.5em 10% .5em 0}

the margin or padding properties (on either the top, bottom or both) should
work just fine.
Jul 20 '05 #3
Jeremy Collins <jd********@ntl world-not.com> wrote:
You could also try line-height:150%
Well, yes, but it has a quite different meaning. Using margin-top and
margin-bottom for li elements is fine. One just needs to remember that
vertical margins don't add up. If you specify
li { margin-top: 0.5em; margin-bottom: 0.8em; }
then the distance between list items is not 0.5em + 0.8em but larger of
0.5em and 0.8em.

The line-height property sets the line height within an element. While
this may create the impression of separation of list items, it's
deceptive. When the display area is narrowed, so that list item
contents wrap, the effect is probably rather disturbing.
(I think anything over 120%
is larger than most browser defaults).


Probably so, despite the fact that CSS specifications recommend that
the default be between 1.0 and 1.2 and even uses the following settings
in the sample style sheet (which is presented as non-normative, yet as
recommended browser default style, and also presented as summary of
actual study of browser behavior, despite the fact many features there
have just been made up):
CSS 1: line-height: 1.1
CSS 2: line-height: 1.33 (above the range recommended in the spec!)
CSS 2.1 CR: line-height: 1.12

What browsers actually use seems to be near 1.2.

The conclusion is that due to this confusion, and due to the fact that
1.2 is too small for many fonts (especially for sans-serif fonts when
line length is large, as it may well be on the Web), authors should
probably set the body element's line-height to a reasonable value
like 1.25 or 1.3. I would use plain numbers due to problems of
inheritance. (If you set e.g. line-height: 150% for a li element, then
the line height inside the element will be 150% of the element's font
size, even in subelements which may have different font sizes - since
the computed value is inherited, not the percentage, but for plain
numbers, it's the number that gets inherited, and gets interpreted in
relation to each element's own font size.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #4
Jukka K. Korpela wrote:

[snip]

There were a few issues there I wasn't aware of; thanks
for taking the time to reply.
--
jc

Remove the -not from email
Jul 20 '05 #5
e n | c k m a wrote:
I use:

li {
margin-left: 0;
margin-right: 10%;
margin-top: .5em;
margin-bottom: .5em;
}

Or...

li {margin:.5em 10% .5em 0}


I can *never* remember the correct order for those one-line
shortcuts! My background is programming, and I'm used to
working with RECT structures where the convention is left,
top, right, bottom. The CSS order of top, right, bottom, left
is counter-intuitive to me (although remembering that they're
both "clockwise" might help).

--
jc

Remove the -not from email
Jul 20 '05 #6
On Sat, 06 Mar 2004 09:00:24 +0000, Jeremy Collins
<jd********@ntl world-not.com> wrote:
I can *never* remember the correct order for those one-line
shortcuts!


I remember CSS starts at noon. Or midnight, and if you're the time cube
guy it's like 4 days ago.
Jul 20 '05 #7
Jeremy Collins <jd********@ntl world-not.com> wrote in
news:Hpg2c.2241 $54.2210@newsfe 1-win:
e n | c k m a wrote:
li {margin:.5em 10% .5em 0}


I can *never* remember the correct order for those one-line
shortcuts! My background is programming, and I'm used to


You mean you have TRouBLe remembering the order?
Jul 20 '05 #8
Eric Bohlman wrote:
Jeremy Collins <jd********@ntl world-not.com> wrote in
news:Hpg2c.2241 $54.2210@newsfe 1-win:

e n | c k m a wrote:
li {margin:.5em 10% .5em 0}


I can *never* remember the correct order for those one-line
shortcuts! My background is programming, and I'm used to

You mean you have TRouBLe remembering the order?


Cute - I'm sure it'll stick now!

--
jc

Remove the -not from email
Jul 20 '05 #9
On Sat, 06 Mar 2004 09:00:24 +0000, Jeremy Collins
<jd********@ntl world-not.com> wrote:
e n | c k m a wrote:
I use:

li {
margin-left: 0;
margin-right: 10%;
margin-top: .5em;
margin-bottom: .5em;
}
Or...

li {margin:.5em 10% .5em 0}
I can *never* remember the correct order for those one-line
shortcuts! My background is programming, and I'm used to
working with RECT structures where the convention is left,
top, right, bottom. The CSS order of top, right, bottom, left
is counter-intuitive to me (although remembering that they're
both "clockwise" might help).


In other words - you have TRouBLe remembering them.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2049
by: Marek Mänd | last post by:
<style> ..menu{ background:yellow; font:12px Arial; } ..menu li{ margin-bottom:0; margin-top:0; padding-bottom:0; padding-top:0;
2
3323
by: fuzzyman | last post by:
In a couple of places on my webpages I have several items that I would like to be arranged vertically. URLS : http://www.voidspace.org.uk/python/index.shtml , http://www.voidspace.org.uk/python/weblog/index.shtml (I'm aware of, and have fixed, some of the validation errors by the way - not yet uploaded new version !) One example is the...
0
2254
by: Old Wolf | last post by:
I have a site that I laid out with tables, and lots of grotty hacks and lots of markup generated by client-side javascript. I'm in the process of converting it to "nice" CSS code but have got stuck on a couple of issues. My pages are going to be used in a situation with fixed viewport (1024x768) and Mozilla browser -- so there are no...
5
8936
by: Goldy | last post by:
Hello, w/ code like this: <table border="0" cellspacing="0" cellpadding="0"> <asp:Repeater runat="server" id="op"> <HeaderTemplate></HeaderTemplate> <ItemTemplate> <tr> <td class="label-item" align="left"> <asp:Label runat="server" id="b1" />
0
1143
by: teddysnips | last post by:
I have a form with 52 text boxes set out in 4 columns of 11 and one column of 8. Guess what they're used for? That's right, displaying weekly information. So, I'm setting them out on a normal aspx page, and being somewhat lazy I just copy and paste from a single text box, so that finally I end up with a control named Textbox52. So I...
1
6148
by: dave8421 | last post by:
Hi, I have a (strict) html document with the following portion: <ul> <li><img alt="" src="images/image1.jpg" /></li> <li><img alt="" src="images/image2.jpg" /></li> <li><img alt="" src="images/image3.jpg" /></li> <li><img alt="" src="images/image4.jpg" /></li> <li><img alt="" src="images/image5.jpg" /></li>
3
12219
by: workingstiff19 | last post by:
First, I'm glad to find a newsgroup that still uses a FAQ: http://www.htmlhelp.com/faq The challenge: These checkboxes (inside a table data TD tag) came out too squeezed together (vertically) so I tried to double-space them with the CSS "line-height" parameter. That did not work (at least for the IE browser), so I put an extra break...
1
1428
by: Malik Marteen | last post by:
My problem is that to fix the top banner (div), I get some strange side effects with the letf_div and the c_div (central area) - the vertical scroll bar dosen't respect the size ove the window (grows past it). With the browser maximized I manage to get a nice look using: height:83%; The problem is that as soon as the browser is resized it...
1
990
by: K Viltersten | last post by:
I'm using this lines of code. ddd<div id="advanced-search" style="visible:false;overflow: auto;"></div>eee I expected "ddd" and "eee" to be vertically close to eachother. As it looks, the DIV is taking up vertical space. What can be done to avoid it? I've tested "visibility:hidden" and "visibility:collapsed" but to no avail.
0
7475
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7664
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7918
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7436
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7766
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5981
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5341
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4958
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.