473,612 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

indentations and line spacing within lists - I'm having problems

I am trying to use css to control the indentation within items in a
list. I would like something that looks like this:
Text of a paragraph goes here, leading to the following list:

* list item 1
* list item 2
* and so on

++++++++

Now the features of the above are:

1. The paragraph has a left margin of 4%. That is, it's left edge is
4% from the edge of the browser window.

2. Skip a line prior to the list beginning.

3. The * represents a bullet or a number - just the symbol
representing the start of a new list item

4. I want the list indented relative to the paragraph.

5. I want single spacing between list items.

Nothing I've tried seems to accomplish what I want. I thought that
using css to set up margin-left: +2% for ul, ol, and li would cause
the margin to be 2% farther left than the existing paragraph margin.
No luck. I thought that line-height: 1 would cause single spacing; it
doesn't. Actually, line-height: .5em seems to work in Netscape and
IE, but I'm not comfortable with that.

So what do I say for ol, ul, li in my style section to accomplish
this?
Jul 20 '05 #1
2 5908
In article <on************ *************** *****@4ax.com> in
comp.infosystem s.www.authoring.stylesheets, puzzled wrote:

[two issues in lists: indentation and vertical spacing]

For indentation, you need to set more than one property. Eric Meyer
explains it excellently at
<http://devedge.netscap e.com/viewsource/2002/list-indent/>.
Nothing I've tried seems to accomplish what I want.


I don't understand the difficulty with spacing. Set
ul, ol { margin-top: 1em; padding-top: 0 }
li { margin-top: 0; padding-top: 0 }
and that ought to do the trick.

Perhaps if you posted the URL of your best (even though imperfect)
effort...

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #2
On Sun, 14 Dec 2003 00:06:17 -0500, Stan Brown
<th************ @fastmail.fm> wrote:
In article <on************ *************** *****@4ax.com> in
comp.infosyste ms.www.authoring.stylesheets, puzzled wrote:

[two issues in lists: indentation and vertical spacing]

For indentation, you need to set more than one property. Eric Meyer
explains it excellently at
<http://devedge.netscap e.com/viewsource/2002/list-indent/>.


My problems were stemming from my accidentally applying a class to
ul/li that I hadn't intended to apply. The Eric Meyer article was
great. Using its simple recommendation, I got my margins the way I
wanted.

For vertical spacing, once I removed the unintended class from ul/li,
line-height: 1em worked as it should have.

Thanks.
Jul 20 '05 #3

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

Similar topics

4
2951
by: Jeff Thies | last post by:
It seems that there can be too many words on a line. This is a problem with pages that are not fixed width. There seems to be a few problems. 1) Finding where the next line starts after finishing a long line. 2) The pages just look too wordy and it is tiring to read. I would think that there are already "formulas" for word count, lineheight
7
7107
by: Danny | last post by:
I have a small <div> element which contains two text blocks - one within <h5> tags and the other within <p> tags. I don't want any extra line spacing between elements so use the display:inline property. This works for IE6 but Opera7.54 and Netscape7.1 add large line spacing between the text blocks and any lines of wrapped text. The line spacing is independant of the font size and is consistent between all lines. ie: it's not larger...
5
2976
by: Andrew Poulos | last post by:
If I have a text INPUT within a block of text how do I 'correct' for the line spacing. The line spacing above and below the INPUT is larger than the line spacing generally: <div style="position:absolute; left:100px; top:100px; width:200px;>blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah <input type="text"...
4
3558
by: fleemo17 | last post by:
Is there a way to tweak the spacing of lines of text (or leading) *specifically* in IE6? I've created a "Quick Search" box in my layout which renders pretty consistently in all the browsers I've tested it on, except in IE6 for the PC. The spacing is completely inconsistent with all the other browsers. (See http://www.sunriveronline.org/misc/clrn ) Is there a way to include a few lines of code in my CSS file that will adjust IE6's...
2
293
by: Amendra | last post by:
Hi, I am using the document.replacechild method to replace some values. But when used, it removes the previous indentation that was in the document for that node. Actually looks like the CRLF is being removed for some reason, any luck. Eg... The original doc
4
2459
by: metoikos | last post by:
I've scoured the web (clumsily, I'm sure) for information on the difficulties I am having, checked my markup in validators, and had a friend with more CSS clue look over it, but I haven't had any luck. I'll detail my difficulties here and hope for help. I will note that I'm using headings to delineate different sections of my message for easier reading. As you can see from the subject, my problems are related to spacing; one of them is...
10
11035
by: phil-news-nospam | last post by:
I have a table with 3 columns in 1 row. I want to increase the spacing _between_ the columns (gutter) _without_ increasing the spacing between those columns and the table itself. Is there a way to do that in CSS without having to code in extra dummy columns in HTML to create gutters? -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ ...
0
1564
by: jkn | last post by:
Hello all I'm having some problems with a list within a menu div. I'm a fairly naive CSS user and suspect there's a concept or two I'm missing... I have an unordered list of link tests within a div that I use as a menu on the left hand side of my page. Because the text for some of these links is wider than the div, I see some word wrap, which is fine. But altering the line-height property of the innermost element - the <aof the link -...
1
4191
by: John Nagle | last post by:
I'm having problems with excessive line spacing in FireFox. This seems to happen when "line-height" is set to "normal" when a large font is in effect, then there's a font change to a smaller font in HTML at a lower level. It looks like line height gets "stuck" at the value in effect in the outer block. DOM inspector shows the line height as "normal" on the small text, but the line spacing renders too big. This is with Firefox 2, so it...
0
8605
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8246
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8415
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7039
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6076
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5532
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4109
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1413
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.