473,386 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Horizontal menu

This works in IE6. A horizontal menu made from a table with the space
created by a td class="gap". All tds are rendered as inline elements
except for .gap. So links are equidistantly spaced. This is to get
around the fact that IE5 doesn't recognise margin or padding-left etc.
It also has the virtue of easily transforming itself to a state
suitable for background images(tabs). That is remove the inline
display and give the tds suitable dimensions. As far as I know this is
the only way to do an automatic menu.

To get onto the question, does it work in IE5? There's a screenshot of
how it should appear. Many thanks.

http://www.sitetype.com/index.php?page=48
Jul 20 '05 #1
5 3114
pe*******@yahoo.com (Peter Cartwright) wrote:
This works in IE6. A horizontal menu made from a table
Why a table? A menu is a list of links, so a <ul> element would make
more sense.
with the space
created by a td class="gap". All tds are rendered as inline elements
except for .gap. So links are equidistantly spaced.
A problem that was only caused by your choice of a table...
This is to get
around the fact that IE5 doesn't recognise margin or padding-left etc.
Table cells don't have margins. But IE5 does recognise padding-left
for table cells. It was probably setting them to display: inline; that
caused the problems. IIRC, IE5 didn't like padding on any inline
element.
It also has the virtue of easily transforming itself to a state
suitable for background images(tabs). That is remove the inline
display and give the tds suitable dimensions. As far as I know this is
the only way to do an automatic menu.
What do you mean by "automatic"?
To get onto the question, does it work in IE5? There's a screenshot of
how it should appear. Many thanks.

http://www.sitetype.com/index.php?page=48


It appears the same in IE 5.01 as in IE6.

However, in Opera 7.23 and Mozilla 1.5 (and I bet quite a few other
browsers as well) the three links appear as a vertical stack. Whoops.

Have a look at http://www.alistapart.com/articles/taminglists/ for
some ideas.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2
Steve Pugh wrote:

Have a look at http://www.alistapart.com/articles/taminglists/ for
some ideas.


Also check out Max Design:

http://css.maxdesign.com.au/index.htm

Tons of techniques to choose from.

Jul 20 '05 #3
Trent L <sp*******@hotmail.com> wrote in message news:<g-********************@comcast.com>...
Steve Pugh wrote:

Have a look at http://www.alistapart.com/articles/taminglists/ for
some ideas.


Also check out Max Design:

http://css.maxdesign.com.au/index.htm

Tons of techniques to choose from.


Interesting stuff, trouble is it deepens the confusion. All the time
I've used CSS I haven't tried setting a width to inline elements.
Because the W3C reference says width only applies to block and
replaced elements. Now that I've tried it - I find I can. Can someone
explain the discrepancy?
Jul 20 '05 #4
pe*******@yahoo.com (Peter Cartwright) wrote:
Interesting stuff, trouble is it deepens the confusion. All the time
I've used CSS I haven't tried setting a width to inline elements.
Because the W3C reference says width only applies to block and
replaced elements. Now that I've tried it - I find I can. Can someone
explain the discrepancy?


Which browsers are using your width style? And are you triggering
standards or quirks mode via your doctype?

Internet Explorer in quirks mode will do lots of things that it
shouldn't and hence is not a good guide to whether your code is
working as it should.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #5
Steve Pugh <st***@pugh.net> wrote in message news:<lk********************************@4ax.com>. ..
pe*******@yahoo.com (Peter Cartwright) wrote:
Interesting stuff, trouble is it deepens the confusion. All the time
I've used CSS I haven't tried setting a width to inline elements.
Because the W3C reference says width only applies to block and
replaced elements. Now that I've tried it - I find I can. Can someone
explain the discrepancy?


Which browsers are using your width style? And are you triggering
standards or quirks mode via your doctype?

Internet Explorer in quirks mode will do lots of things that it
shouldn't and hence is not a good guide to whether your code is
working as it should.

Steve


Yes that was it.

I had a closer look at the list menus but they won't work in this
case. That is a menu element that can either take the width of its
contents or have a fixed width - in other words a td. In any case the
list items aren't contained by the ul in Opera. And in IE there's an
unwanted margin-top (or whatever it is) on the li. See

http://website.lineone.net/~peterct07/list_version.htm
Using a table I think I've found a solution or several. I don't think
the padding-left or margin-left on anchors will work in IE5, which is
what I was referring to in an earlier post. But I've put up some
examples in case I'm wrong on that. Probably the inelegant example,
giving a float:left and width to a div sitting alongside the anchor,
is the best bet. I'd be surprised if it doesn't work, but can you tell
me what you find in IE5?

Incidentally Opera looks like it gets the first two examples wildly
wrong.

http://website.lineone.net/~peterct07/table_version.htm
Jul 20 '05 #6

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

Similar topics

13
by: elad | last post by:
Hi The Menu doesn't work properly when I have 2 frame and the Menu popup frame=document target frame, when I choose item in the menu the doc opened and the menu get stuck. Here is the code...
2
by: Ansgar Hein | last post by:
I have been playing around with several different versions for a horizontal menu, but I haven't been able to build a horizontal navigation based on the vertical one featured on www.alistapart.com...
15
by: theo | last post by:
Hi, I'm working on a horizontal row menu, to use like folder tabs. Does anyone know what the CSS style "cursor" is supposed to produce? Any working samples? I put it in the code, but can't see...
5
by: Chris Beall | last post by:
Objective: Using an HTML list, create a horizontal nav menu with these characteristics: - All menu items have the same width at all times. - When the window width is reduced, the menu items...
2
by: Sergio E. | last post by:
Hi group, I write this post with the following question: How can I to build an absolutely horizontal menu?, This is because I can't find how can I configure the menu component of asp.net 2.0...
1
by: camphor | last post by:
hi, I have a single column webpage with a horizontal dropdown menu and am trying to make the nav bar fit across the page, the column is 800px, it looks ok in dreamweaver 8 but when I test it in...
5
Haitashi
by: Haitashi | last post by:
Hello everyone: I have a CFMenu with the type set to horizontal. I'd like to have the sub-menu items open vertically. Is that possible? Here is my code. I want the Portals sub-menu (Portal A,...
19
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.