473,803 Members | 3,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List/menu spacing is browser dependent (argh)

Hello,
I am (slowly) in the process of changing a table-based layout to
CSS/div-based. One area that uses tables a lot is the main nav menu. I
have discovered that tables have advantage: all browsers display them the
same.
I created a CSS to use <ul> as the list container rather than <table>.
It works quite well -- in Mozilla. With IE V5 or 6 extra spacing is added
between each button image and the large spaces are compressed; it is
almost a uniform spacing between all buttons. Opera 7 completely ignores
the attempts to provided additional space; all buttons are abutted, no
space at all.
(Another exciting discovery is about the nature of lists. They do not
take kindly to varying heights in the content. That is why the spacing
looks irregular when viewed with Mozilla (or Firefox).)
So. Is there a CSS/div method that works for most current(-ish)
browsers? Um, that looks like Mozilla's rendering?
(Yes, I could go to text for the menu items rather than the images. I'd
rather not. Not yet, anyway. Clients get cranky that way.)

<http://www.sohnen-moe.com/test.html>

The relevant CSS is:
#menuleft1 { width: 160px;
margin: 50px 0 0 0;
padding: 0; }
#menuleft1 ul {
margin: 0 0 0 5px;
padding: 0; }
#menuleft1 li { float: left;
line-height: 0%;
list-style: none; }
#menuleft1 li p { height: 30px; }
--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 21 '05 #1
1 3312
Tim
On Thu, 20 Jan 2005 23:15:01 -0700,
Jim Moe <jm************ ***@sohnen-moe.com> posted:
I am (slowly) in the process of changing a table-based layout to
CSS/div-based. One area that uses tables a lot is the main nav menu. I
have discovered that tables have advantage: all browsers display them the
same.
Not entirely true...
I created a CSS to use <ul> as the list container rather than <table>.
It works quite well -- in Mozilla. With IE V5 or 6 extra spacing is added
between each button image and the large spaces are compressed; it is
almost a uniform spacing between all buttons. Opera 7 completely ignores
the attempts to provided additional space; all buttons are abutted, no
space at all.


If you want to control the layout, then you really need to set all of the
parameters (margins and padding on the UL, and the LI elements, and perhaps
the surrounding element). Then on some browsers you'll have to be very
careful of how you type the HTML. e.g. <li><img></li> may be treated
differently than <li> <img> </li> (whether that white space be blank spaces
or new lines).

There's sometimes an additional problem with using images: Whereabouts
they sit. We tend to think of them starting at the top of the available
space and filling it, but they're an inline text replacement, and sit on
the baseline of the text (by default). This can mean seemingly
inexplicable blank space below an image (reserved for the descenders of
text that isn't there).

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 21 '05 #2

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

Similar topics

1
2060
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
1354
by: Brian | last post by:
Hello, I want to design some menus for websites with submenus. I'd like to learn the code myself and I was wondering a good place to pick up on some tips on how to design them. Also, is there a decent program out there that does it all for you at a good price? Thanks,
9
3095
by: cmac | last post by:
Greetings, I love the HV menu and have been uning it for a long time. I recently was asked how to make a page for my wife (wedding coming up soon) and my wife would like to have 2 ways to navigate on the same page. So essentially i would like to have a Horizontal menu and a vertical menu for people to navigate with. From everything i have been reading i dont think this is possible as both menus would call the same config file...
8
2588
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and courses are populated. When course is selected, lists of occurrences, groups and
0
1571
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 -...
4
3992
by: tburger | last post by:
Hey everyone- This is my first post at The Scripts, but I've used the forums before for other programming issues. Hopefully, someone has some solid styling advice for me. I've now been dealing with XHTML/CSS for about a week. I'm trying to set up a website for my dad, and this navigation menu is driving me nuts. I designed this part of the site on Firefox 2.0. Here's the link: http://www.yalestartups.com/tburger/test.html
10
2188
by: lenzie | last post by:
I am having a very odd problem with a website I run. The menus have recently been changed to use javascript and some people are reporting that when they first use the site, Instead of a nicely aligned list of items each in its own light-blue box. They are seeing a straightforward <li> list with no styles. The biggest problem is that I think it is only seen the first time someone goes to the site and so I can't see it!!! So if anyone could...
1
2970
by: jmartmem | last post by:
Greetings, I have a nagging problem with client-side dynamic dependent list boxes that perhaps someone can help me troubleshoot. I have a form with a series of dynamic dependent list boxes. Making a selection from list/box A (Qtr) selects a fiscal quarter, which then refreshes the values in list/box B (Mth), which shows the 3 months in that fiscal quarter, which then refreshes the values in list/box C (MthDate), which returns the date...
0
9700
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10546
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...
0
10310
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10068
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
9121
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
7603
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
6841
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
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2970
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.