473,756 Members | 7,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Height of Horizontal Menu

Hi,
In the "Firefox 5 Minute Challenge" [1] that I'm trying to write the
stylesheet for, the height of language bar needs controlled by the
height of the content, so that if the window is not wide enough, and the
menu items wrap around to the next line, the height of the <ul>
increases, and thus the background stays behind the list items.

The height has been set using min-height for for those that support it
and 'height' for IE only. It works the way I want it in IE and Opera.
But, it does not work in Firefox. I'm not sure whether Firefox's or
Opera's rendering is correct (I know IE's isn't, because I had to add
the hack for it), but does anyone know how I can get it to work in
Firefox also?

[1] http://lachy.id.au/dev/mozilla/firef...nute/challenge

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
Jul 21 '05 #1
7 2226
in comp.infosystem s.www.authoring.stylesheets, Lachlan Hunt wrote:

[floats in container, container has background]
The height has been set using min-height for for those that support it
and 'height' for IE only. It works the way I want it in IE and Opera.
Not on Opera either, at least 7.6p2
but does anyone know how I can get it to work in Firefox also?
1) #language li, #language a { display: inline; } /* instead current */
Sort out problem with PDF image differently. Would be easy with
display:inline-block or inline-table, but FF dont support them. You could
float the pdf thing, and use inline for others.
2)
Set background for body, instead of ul. Then set background for
#conteiner. This has side effect of overriding users default background.
3) ul:after {display:block; content:"";clea r:both}
Most likely don't work on FF, does in Opera.
4) wrap ul in div, have <div style="clear:bo th">&nbsp;</div> under ul.
(there is bug in Gecko that it don't get empty elements)
5)
Add additional, empty list item, that will have clear:both etc. Not good
idea.
There might be other ways too, but I think one of these should do.
[1] http://lachy.id.au/dev/mozilla/firef...nute/challenge


Well, the problem with wrapping language bar background is very minor
compared to other, extreamily serious problems, when looking it in narrow
eaboug window to get lan bar wrap. At least I have my text zoom at
smallest (11px).

Only tested stuff in Opera.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #2
Lauri Raittila wrote:
in comp.infosystem s.www.authoring.stylesheets, Lachlan Hunt wrote:

[floats in container, container has background]

The height has been set using min-height for for those that support it
and 'height' for IE only. It works the way I want it in IE and Opera.

Not on Opera either, at least 7.6p2


I tested it in Opera 7.54 and it works. I couldn't find where to get
7.6p2, but it's obviously an upgrade and maybe they've fixed a bug with
it, which would mean Opera 7.54's current behaviour is likely to be
incorrect. I had a feeling it was, but wasn't totally sure.
but does anyone know how I can get it to work in Firefox also?


1) #language li, #language a { display: inline; } /* instead current */
Sort out problem with PDF image differently. Would be easy with
display:inline-block or inline-table, but FF dont support them. You could
float the pdf thing, and use inline for others.


Yes, I wanted to use inline-block. I knew it would be perfect, but had
to face reality when I realised neither IE or firefox has implemented it.

I considered using inline, but then it's there's spaces between each
<li> which get rendered as a single space. I used the floats to avoid
that problem, so there is no gap.
2)
Set background for body, instead of ul. Then set background for
#container. This has side effect of overriding users default background.
That may be the best option, I'll think about that.
3) ul:after {display:block; content:"";clea r:both}
Most likely don't work on FF, does in Opera.
Definately won't work in IE, and I'd prefer to have very few, if any,
user-agent specific CSS. Ideally, I would be able to remove the 1 hack
that's in there at the moment and use the same CSS for all.
4) wrap ul in div, have <div style="clear:bo th">&nbsp;</div> under ul.
(there is bug in Gecko that it don't get empty elements)


I prefer to avoid extraneous elements.
[1] http://lachy.id.au/dev/mozilla/firef...nute/challenge


Well, the problem with wrapping language bar background is very minor
compared to other, extreamily serious problems, when looking it in narrow
eaboug window to get lan bar wrap. At least I have my text zoom at
smallest (11px).


Yes, I know it's minor at the moment, but if I get more translations,
and therefore it doesn't require such a small window to wrap, then it
will. But you're right, compared with the other issues I'm still yet to
work on, it is fairly minor.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
Jul 21 '05 #3
in comp.infosystem s.www.authoring.stylesheets, Lachlan Hunt wrote:
Lauri Raittila wrote:
in comp.infosystem s.www.authoring.stylesheets, Lachlan Hunt wrote:

[floats in container, container has background]
I couldn't find where to get [Opera] 7.6p2,
http://www.google.com/search?q=7.6p2+opera
but it's obviously an upgrade and maybe they've fixed a bug with
it, which would mean Opera 7.54's current behaviour is likely to be
incorrect. I had a feeling it was, but wasn't totally sure.
I had not seen the bug on 7.54, and it can be only temporary bug, as this
has worked correctly in 7 series...
but does anyone know how I can get it to work in Firefox also?


1) #language li, #language a { display: inline; } /* instead current */
Sort out problem with PDF image differently. Would be easy with
display:inline-block or inline-table,


Yes, I wanted to use inline-block. I knew it would be perfect, but had
to face reality when I realised neither IE or firefox has implemented it.


In IE it works on inline stuff (don't ask why), so
display:inline; display:inline-block;display:i nline-table;

Would give quite good results, as it would only look a bit different
in FF...
I considered using inline, but then it's there's spaces between each
<li> which get rendered as a single space. I used the floats to avoid
that problem, so there is no gap.
What harm does that gap do? You need some white space between the links
anyway. And you can of course get rid of that whitespace. Just remove all
spaces and tabs between tags. (you can leave linebreaks)
3) ul:after {display:block; content:"";clea r:both}
Most likely don't work on FF, does in Opera.


Definately won't work in IE, and I'd prefer to have very few, if any,
user-agent specific CSS.


It is not user agent specific. Some browsers just don't support it...

That is what cascading is all about.
Ideally, I would be able to remove the 1 hack
that's in there at the moment and use the same CSS for all.


Tricker quirks mode, and hope there is nothing that will broke? (IE had
bug that does what you want...)

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #4
Lauri Raittila wrote:
In IE it works on inline stuff (don't ask why), so
display:inline; display:inline-block;display:i nline-table;
That could be a good idea because it uses a fallback mechansim, rather
than a specific browser hack. I'll think about using something like that.
I considered using inline, but then it's there's spaces between each
<li> which get rendered as a single space. I used the floats to avoid
that problem, so there is no gap.


What harm does that gap do?


It creates non-clickable regions between the links, which I dislike in
navigation bars.
You need some white space between the links anyway.
No, there just needs to be sufficient padding to make the links large
enough to be easily targetted with the cursor
And you can of course get rid of that whitespace. Just remove all
spaces and tabs between tags. (you can leave linebreaks)


That won't work since all white space characters in HTML including
spaces tabs and line breaks are collapsed to a single space.
...I'd prefer to have very few, if any, user-agent specific CSS.


It is not user agent specific. Some browsers just don't support it...


I didn't mean user agent specific as being proprietary, I just meant
user agent specific, in that hacks, although they're valid, are usually
written for just one browser. There's a difference between writing a
hack and using a fallback mechanism, which is acceptable.
Ideally, I would be able to remove the 1 hack
that's in there at the moment and use the same CSS for all.


Tricker quirks mode, and hope there is nothing that will broke? (IE had
bug that does what you want...)


I definately will not trigger quirks mode in any browser, it must be
done with standards or not at all. I don't understand why you even
suggested that, considering that it would just be a different kind of
hack, which I said I want to avoid.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
Jul 21 '05 #5
in comp.infosystem s.www.authoring.stylesheets, Lachlan Hunt wrote:
Lauri Raittila wrote:
In IE it works on inline stuff (don't ask why), so
display:inline; display:inline-block;display:i nline-table;


That could be a good idea because it uses a fallback mechansim, rather
than a specific browser hack. I'll think about using something like that.
I considered using inline, but then it's there's spaces between each
<li> which get rendered as a single space. I used the floats to avoid
that problem, so there is no gap.


What harm does that gap do?


It creates non-clickable regions between the links, which I dislike in
navigation bars.


It is good to have non-clickable regions between links. If there aren't,
it is hard to know which link you are clicking. (assume :hover is
forbidden for example)

There should be non-link printable characters between links
http://www.w3.org/TR/WCAG10/#tech-divide-links
Remeber screen readers that use IE. Not having anything between links is
even worse, I assume. I have not tested such things, so I can say
anything by experiance.
You need some white space between the links anyway.


No, there just needs to be sufficient padding to make the links large
enough to be easily targetted with the cursor


The problem is that space between links needs something that is not link,
so that user knows which is link and which is other.
And you can of course get rid of that whitespace. Just remove all
spaces and tabs between tags. (you can leave linebreaks)


That won't work since all white space characters in HTML including
spaces tabs and line breaks are collapsed to a single space.


You are right, I was remembering wrong. You could do
<ul>
<li>fi
</li><li>se
</li>
</ul>

though.
http://www.w3.org/TR/REC-html40/appe...es-line-breaks
Ideally, I would be able to remove the 1 hack
that's in there at the moment and use the same CSS for all.


Tricker quirks mode, and hope there is nothing that will broke? (IE had
bug that does what you want...)


I definately will not trigger quirks mode in any browser, it must be
done with standards or not at all. I don't understand why you even
suggested that, considering that it would just be a different kind of
hack, which I said I want to avoid.


If you don't want to use quirks mode, you have already done some decision
on grounds of supporting specific browsers. In reality, something else
must be done than just give correct CSS to all browsers, if you aren't
willing to do lots of compromises on how things will look.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #6
Lauri Raittila wrote:
in comp.infosystem s.www.authoring.stylesheets, Lachlan Hunt wrote:
It creates non-clickable regions between the links, which I dislike in
navigation bars.
It is good to have non-clickable regions between links. If there aren't,
it is hard to know which link you are clicking. (assume :hover is
forbidden for example)


Not when the links are large enough, and visual feedback is given
appropriately. In my experience, having a space between a link makes
targetting and clicking a link harder as it is too easy to slip off the
link into that gap.
There should be non-link printable characters between links
http://www.w3.org/TR/WCAG10/#tech-divide-links
That refers to having space between links in the markup. Whether or not
those spaces are dispalyed visually on the screen (depending on how they
are removed) is irrelevant. In this instance because the li are floated
which effectively removes the spaces visually, it doesn't hurt.
You could do
<ul>
<li>fi
</li><li>se
</li>
</ul>
Ha? That would violate Guidline 10.5! Why would you tell me about it
and then suggest a solution that violates it?
I definately will not trigger quirks mode in any browser, it must be
done with standards or not at all. I don't understand why you even
suggested that, considering that it would just be a different kind of
hack, which I said I want to avoid.


If you don't want to use quirks mode, you have already done some decision
on grounds of supporting specific browsers.


Now that's the most ridiculous statement I've read in a while. Choosing
to support *standards* rather than undefined quirks mode behaviours of
proprietary browsers is the exact opposite of supporting specific
browsers. Not only that, given the content, and the fact that part of
the reason for spreading Firefox is to support *standards*, it would be
extremely hypocritical to trigger quirks mode.
In reality, something else
must be done than just give correct CSS to all browsers, if you aren't
willing to do lots of compromises on how things will look.


I am far more willing to compromise on presentation than I am to
compromise on the markup, especially when it comes to a decision as
insane as choosing quirks mode over standards mode.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
Jul 21 '05 #7
in comp.infosystem s.www.authoring.stylesheets, Lachlan Hunt wrote:
Lauri Raittila wrote:
in comp.infosystem s.www.authoring.stylesheets, Lachlan Hunt wrote:
It creates non-clickable regions between the links, which I dislike in
navigation bars.
It is good to have non-clickable regions between links. If there aren't,
it is hard to know which link you are clicking. (assume :hover is
forbidden for example)


Not when the links are large enough, and visual feedback is given
appropriately.


There was nothing but whitespace between those links. When hovered, there
was slight color change, IIRC. That is not much visual feedback.
In my experience, having a space between a link makes
targetting and clicking a link harder as it is too easy to slip off the
link into that gap.
But, at least it is better than slip to wrong link. Gap doesn't need to
be big gap. (hint: ul {font-size:50%;} li {font-size:200%})
There should be non-link printable characters between links
http://www.w3.org/TR/WCAG10/#tech-divide-links


That refers to having space between links in the markup. Whether or not
those spaces are dispalyed visually on the screen (depending on how they
are removed) is irrelevant.


Is it really. Have you made a study?
In this instance because the li are floated
which effectively removes the spaces visually,
In case of display:inline, the stuff is no more floated, BTW.
it doesn't hurt.
Screen readers often work on visual browsers, like MSIE. Of course, user
might have had sence to turn of CSS.
I definately will not trigger quirks mode in any browser, it must be
done with standards or not at all. I don't understand why you even
suggested that,

It was not serious suggestion...
If you don't want to use quirks mode, you have already done some decision
on grounds of supporting specific browsers. Now that's the most ridiculous statement I've read in a while.
Think about it again. Quirks vs. Standards modes are not defined by any
spec, and don't follow any specific rules. Rules are in fact bit
different for every browser.
Choosing
to support *standards* rather than undefined quirks mode behaviours of
proprietary browsers is the exact opposite of supporting specific
browsers.
But it is. You could use any of about 8 official (X)HTML strict doctypes,
but you need choose between the ones that tricker standards in browsers.
Not only that, given the content, and the fact that part of
the reason for spreading Firefox is to support *standards*, it would be
extremely hypocritical to trigger quirks mode.
Yes, but if you did choose doctype that will tricker standards becuase it
trickers standard, and not some other reason, you have made desision to
aim for certain browsers. The decision is of course very good, but shows
that you need to do compromises, as world is not ready.
In reality, something else
must be done than just give correct CSS to all browsers, if you aren't
willing to do lots of compromises on how things will look.


I am far more willing to compromise on presentation than I am to
compromise on the markup,


There is absolutely no need to compromise on markup, when trickering
quirks or standards...
especially when it comes to a decision as
insane as choosing quirks mode over standards mode.


Markup has nothing to do with that. Remember, there is standard doctype
that does tricker quirks. Nobody uses it. (Well practically nobody uses
the standard doctype that trickers standards either... ,-)
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #8

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

Similar topics

2
5316
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 in the article "taming lists". However I have managed to build a horizontal navigation but it has a slight hitch in Mozilla and Opera, but it's fine in Internet Explorer. It is a strange occurrance of a 4 - 5 Pixel bar in grey (which is the...
15
9177
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 anything resolve. http://www.w3schools.com/css/pr_class_cursor.asp It's probably staring right at me, but can someone tell me why hover isn't working in IE, but does in Mozilla? http://wholives.com/temp/tabs.htm me
12
10175
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical scrollbar, you get the height of the entire document, screwing up any chance of centering a window in the browser using these values. Is there a way to get the height of the actual browser window and not the entire page height? Thanks.
6
2380
by: ciwstudy | last post by:
I'm having problems getting the height to compress for a horizontal list in IE (styled with CSS). It works fine in other browsers. Does anyone know a way to fix this? http://www.uky.edu/Home/Web/newnavbar/
5
4557
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 stack, rather than creating a horizontal scroll bar. - The menu cluster is always centered on the window. See http://pages.prodigy.net/chris_beall/Demo/centered%20horizontal%20list.html
2
9330
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 in vs2005. I need somthing like this: the root menu in this form
3
3242
by: Arielle | last post by:
Problem: Using an XHTML doctype for all our pages, this is not optional. The layout the client wants to use requires the site to be "full screen" with a header, footer, horizontal menu, and main content area. The header may or may not be absolute, the menu and footer are absolute, and the main content is dynamic to fill the rest of the space. The idea is to use javascript to make up where css lacks forcing things to a full height. This...
5
3399
by: Author | last post by:
I am new to CSS and I posted this question to the macromedia.dreamweaver newsgroup yesterday, but unfortunately no one seems to have a clue. At least no one has responded. So, I am posting it here and see if I will get any luck. I have a left div, which contains the navigation menu items, and a right div, which is the main content area. I set a background image (repeat-y) for the left div through css's background: url property.
4
4332
by: Christopera | last post by:
Hello, I have built a site that uses two divs, one verticle, and one horizontal as graphic style for the ite. The problem I am having is that if the browser is resized very small the divs are then smaller than the website is wide. I have tried fixed positioning but then i get the dreaded overlap when the browser is smaller than the website. Absolute positioning gets rid of the overlap but then brings on the width issue. Is there a way to...
0
9456
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
9275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9873
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...
1
9846
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
9713
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...
1
7248
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
5142
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
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

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.