Skip to page content or skip to Accesskey List.
Search evolt.org
evolt.org login: or register

Work

Main Page Content

Successful inline lists in Netscape 4

Rated 3.68 (Ratings: 6) (Add your rating)

Log in to add a comment
(18 comments so far)

Want more?

 
Picture of bmason

Bill Mason

Member info | Full bio

User since: October 10, 2000

Last login: April 15, 2007

Articles written: 5

One of the still (fairly) recent innovations in coding is the horizontal inline list. That is, a list (typically a ul) whose rendering is changed via CSS to display as a non-bulleted, horizontal line of text. It has come into vogue as a means for rendering horizontal navigation bars while maintaining semantically correct coding. Taming Lists gives a solid rundown of the basics of the inline list technique.

The technique simply uses the CSS rule display : inline applied to the li tags to make the bullet list render without bullets and horizontally. Up until now (as far as I know) no one was using this with Netscape 4 because of its infamous buggy CSS support. A typical example renders like this:

The technique fails because Netscape 4 keeps the bullet in front of the item, overlapping the text.

Compliant browsers when they render this CSS remove the bullet since the li is no longer being displayed as a list-item.

But by accident, I found a solution. As an exercise, I was recoding the new mozilla.org/Mozilla Foundation home page as a CSS-driven layout instead of a table-driven one. In my revision, I did the upper horizontal navigation bar (above the Google search field) as an inline list. All well and good.

I started playing with the code since it just bugged me that Netscape 4 couldn't get a clean horizonal layout minus the bullets. Then I hit on a technique for clean Netscape 4 inline lists. It renders like so:

This time, the items have no bullets remaining that overlap the text.

The code to accomplish this is as follows:

li {
  display : inline;
  /*/*//*/
  display : none;
  /* */
}

(Here's a testcase to view as well. Note that in my rebuilt mozila.org page, the navigation is at the page bottom due to some other issues with the CSS as it applies to Netscape 4.)

Using display : none, in Netscape 4's twisted way of rendering, removes the bullets but not the textual content. Of course, we can't let compliant browsers act on the display : none or they will just hide everything. So Fabrice's Inversion is used to hide this code from the compliant browsers.

And there you have a basic inline list in Netscape 4! It even works in the really old 4.08 version without crashing. (Note too that my mozilla.org page will crash Netscape 4.0x because of other CSS that I'm not concerned with debugging, frankly.)

I don't know how much styling you could apply to the li to pretty it up without causing new problems in Netscape 4. It's an exercise for the reader. But at least where you have a nice-looked tabbed horizional navigation or the like, you can let it degrade it down to a basic horizontal bar in Netscape 4.

Front-end web development (mostly) and an interest/focus in web accessibility. I also recently co-authored my first book, The Web Professional's Handbook, published by the late great glasshaus.

I've been out of work since October 2001. Be kind and glance over my portfolio....

KISS

Submitted by ic on July 25, 2003 - 04:09.

Why hacks? li { list-style: none; display: inline } That's all.

login or register to post comments

Seconding KISS

Submitted by csaila on July 25, 2003 - 07:08.

The method ic mentions is being used on the top and bottom navigation of globefund.com (a large Canadian news site about mutual funds) quite successfully.

login or register to post comments

Well, that's much cooler

Submitted by bmason on July 25, 2003 - 09:43.

I like that much better. I thought I tried something like that when I was hacking around, but I guess not. Thanks!

It's funny how you discover things after the fact, after reading all sorts of pages about inline lists.

login or register to post comments

Variable success

Submitted by tripst3r on July 25, 2003 - 10:14.

The comment hack method, however, worked in NN 4.7 for me for both OL and UL while the no-hack method only worked for UL. In the latter case, the OL displayed inline but kept the numbers.

login or register to post comments

OK, I switched back to my method

Submitted by bmason on July 25, 2003 - 11:51.

Besides tripst3r's reason (which I never even experimented with since I didn't need an OL for the page I was doing), the non-hacked method produces question mark bullets in Netscape 4 Mac. While that can be easily worked around, I went back to my method because it's just one hack and done instead of one method and then more code for Netscape 4 Mac's sake.

Knowing that, at least I got back the feeling that I contributed something to the universe today....

login or register to post comments

With an OL

Submitted by csaila on July 25, 2003 - 15:24.

Not meaning to diminish your article by any means—the more methods we can whip Netscape 4 into shape the better, and it provokes discussion—but you can also remove the list numbers from ordered lists by adding one extra rule:
<strong>ol { list-style: none; }</strong><br>
li { list-style: none; display: inline; }

login or register to post comments

Why?

Submitted by brothercake on July 31, 2003 - 16:56.

Not to pour water on your fire ... but what's the point? You concede yourself that the page you made to demonstrate this crashes 4.0x for other reasons ... so why style that browser at all? If some builds are going to crash from the application of CSS then you're decreasing the overall accessibility / x-browser compatibility of the page.

I believe it's worse than a waste of time to get CSS/XHTML pages to look good in ns4 ... it should get the plain, unstyled semantic layout, because that's the most useable.

login or register to post comments

Re: Why?

Submitted by bmason on July 31, 2003 - 18:01.

I believe it's worse than a waste of time to get CSS/XHTML pages to look good in ns4 ... it should get the plain, unstyled semantic layout, because that's the most useable.

I tend to agree as a matter of philosophy, though obviously not every client would. In this case, I just wanted to go through the exercise of redoing the page for the interest of seeing how it would turn out. The whole inline list exploration just happened as a offshoot. Since it was my exercise, I decided I didn't feel like doing 4.0x debugging. I'm sure I could get it working in 4.0x; it would probably just meaning stripping some more of the styling out and create a plainer experience overall for Netscape 4.

While I would never suggest anyone using a page live that causes browser crashes, it would also be nice if those still on Netscape 4 at least be on the last version. In my last employed position, not only was a page that was friendly to Netscape 4 a requirement (which usually meant using a table to handle the overall layout, then CSS for finer styling), we had to work in version 4.08 as well. That often made using proper HTML a pain, nevermind the styling.

login or register to post comments

Yeah I sympathise

Submitted by brothercake on July 31, 2003 - 18:38.

I also had to build a site for a company where everbody used 4.08 ... what a nightmare; taught me some robust coding hacks though ... most of which I'm happy to have discarded :)

Since then I've taken to using 4.03 for testing - it seems the least stable of them all, and hence the most practical test ::

login or register to post comments

what would happen

Submitted by Misha on August 1, 2003 - 10:54.

What would happen if we all stopped coding for NN4, and simply put a redirect to a warning page (or add a div with a warning that disappears on modern browsers)? I honestly can't imagine anyone who needs to use NN4 still. Are we doing ourselves a disservice by wasting so much time on this? If Blockbuster stopped renting betamax, I would buy a VHS vcr without a problem.

Are there alternative older browsers with better CSS support?

login or register to post comments

Don't you mean, "what is happening" ..?

Submitted by brothercake on August 1, 2003 - 15:41.

Personally, I won't advocate not supporting any browser, and I would never encourage the use of redirects, warnings or one of those awful "please upgrade your browser" pages.

But there's a difference between content and rich content. An XHTML/CSS page has two layouts - the styled visual layout, and the plain semantic layout. Netscape 4 should get the latter, using things like @import to ensure it doesn't read any CSS. I've been doing this for a year or so ... and I thought I was behind the times then .. to be honest I double-take these days when people say they still fully support it ..

It has to be this way; we can't embrace the semantic web until we let go of tag soup; and we can't let go of tag soup until we stop providing rich content for legacy browsers.

login or register to post comments

Liberate yourselves

Submitted by toolkit on September 6, 2003 - 15:31.

I think anyone is mad if they choose to support web browsers written before the start of this century...

login or register to post comments

New to CSS

Submitted by c1sissy on February 2, 2004 - 05:13.

Hi Everyone. I'm new to css, and I have found this list through a search for doing a horizontal navigation. I'm interested in how the @import is used. If anyone could guide me I would appreciate it. I learn by tutorials, and I am self taught. At this point I am working on learning xhtml and css. I have found this discussion very interesting. Thanks in advance.

login or register to post comments

Re: New to CSS

Submitted by bmason on February 2, 2004 - 22:01.

You might try these pages for @import references:

login or register to post comments

New to Css

Submitted by c1sissy on February 3, 2004 - 04:42.

Hi bmason: Thanks for the links, I appreciate them instead of an explaination ;>). I'm a firm believer in researching the thing first, and trying it, then if it won't work, asking for help. :>)

login or register to post comments

dreamweaver's code

Submitted by Misha on February 3, 2004 - 09:47.

dreamweaver's code:

login or register to post comments

hmm didn't come through

Submitted by Misha on February 3, 2004 - 09:49.

That's odd, it worked in the preview. Check out the source of aloosenation.com for dreamweaver's code. zeldman.com has an alternate version. I don't really know the difference.

login or register to post comments

nn4

Submitted by shiva7663 on April 2, 2004 - 10:05.

I decided to keep coding for nn4 when an examination of my access logs showed that one of my highest traffic web pages had over 10 percent NN4 users three months in a row not too long ago. My results may not be typical, but it's best to consult your access logs before making a big decision like that.

login or register to post comments

The access keys for this page are: ALT (Control on a Mac) plus:

evolt.orgEvolt.org is an all-volunteer resource for web developers made up of a discussion list, a browser archive, and member-submitted articles. This article is the property of its author, please do not redistribute or use elsewhere without checking with the author.