473,505 Members | 13,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with ul based navigation on Opera 7.x

Hi,

I have a problem to get this working on Opera 7.x+. This does not need
to work on older Opera browsers

There are problems on rendering the sub-level navigation. It aligns
right on Firefox and IE 6.
Sometimes there are also some problems on IE 5 or IE 5.5.

I would like the navigation to work like this:

* The menu item width should not be defined because it differs on every
language.

* The sub navigation item should be aligned to the mainmenu containing
the menu item. The problem with Opera
comes if we have more than one subnavigation items. The items aren't
aligned next to each other. Instead they are
aligned one item per line.

Thanks in advance.

----------------------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Test navigation</title>

<style type="text/css">
<!--
html {margin:0px;}
body {margin:0px;padding:0px;font-family: Arial, Helvetica,
sans-serif;font-size: 62.5%;}

#navwrapper{font-family: Arial, Helvetica,
sans-serif;font-size:1.2em;width:712px;height:48px;margin:0px 0px 10px
0px;}

#navleft,#navright {float:left;width:8px;height:48px;}

#navitems {position:relative;left:0;top:0;margin:0px 0px 0px 0px;}

#main_navi {margin:0;padding:0;list-style:none;display:inline;}
#main_navi li {margin:0px 0px 0px
0px;padding:0px;float:left;position:relative;}

#main_navi .divider,
#main_navi .divider:active
{float:left;text-decoration:none;font-weight:bold;display:block;margin:0px;padding:5px
6px 5px 6px;}

#main_navi .no_divider,
#main_navi .no_divider:active
{float:left;text-decoration:none;font-weight:bold;display:block;margin:0px;padding:5px
6px 5px 6px;}

#main_navi li.on{
color:#2C568B;background-color:#E7F0FF;height:25px;float:left;text-decoration:none;font-weight:bold;margin:0px;padding:0px;}

#sub_navi
{position:absolute;left:0px;top:25px;margin:0;padd ing:0;list-style:none;display:inline;
white-space:nowrap;}

#sub_navi li
{float:left;height:22px;text-decoration:none;font-weight:bold;margin:0px;padding:0px;display:inline; }

#sub_navi li.list_on
{height:22px;float:left;text-decoration:none;font-weight:bold;margin:0px;padding:0px;}

#sub_navi span.link_on
{color:#2C568B;float:left;text-decoration:none;font-weight:bold;
margin:0px;padding:4px 6px 4px 6px;}

#search {margin:0px 0px 0px 500px;padding:4px 0px 0px 3px;height:25px;}
#search_box{width:130px;height:18px;margin:0px 5px 0px 4px;border:1px
solid #A4ABB1;float:left;}
-->
</style>
</head>

<body>

<div id="navwrapper">
<div id="navleft">&nbsp;</div>
<div id="navitems">
<ul id="main_navi">
<li><a href="#" class="divider">Menu 1</a></li>
<li class="list_on"><span class="divider">Menu 2</span>
<ul id="sub_navi">
<li><a href="#">Sub Menu 1</a></li>
<li class="list_on"><span class="link_on">Sub Menu 2</span></li>
</ul>
</li>
<li><a href="#" class="divider">Menu 3</a></li>
<li><a href="#" class="divider">Menu 4</a></li>
<li><a href="#" class="divider">Menu 5</a></li>
<li><a href="#" class="no_divider">Menu 6</a></li>
</ul>
<div id="navright">&nbsp;</div>
</div>
<div id="search">
<form name="form1" id="form1" method="post" action="#">
<input type="Text" name="qt" id="search_box" />
<a href="javascript:document.form1.submit();">Search</a>
</form>
</div>
</div>
</body>
</html>

Jul 21 '05 #1
3 2369
I'm still having problems with this. Can anyone help me with this?

Jul 21 '05 #2
Els
et*******@hotmail.com wrote:
I'm still having problems with this. Can anyone help me with this?


You are lucky that I also see the message you are replying to - it's 3
days old though, so I'm sure most people will ignore this message of
yours, as they have no idea what you're talking about.

As to why your previous post got ignored:

a) you're not supplying a URL, and most people don't have the time to
waste to copy your code from your message, save it in a file, upload
it to their own server, and then look at the problem. Please remember
that it's *your* problem, and you should make it as easy as possible
for others to see, to get more people willing to help you.

b) you're using google groups, and more and more people are ignoring
posts from google groups, as they almost invariably don't quote what
they're replying to (bingo! that's you!).

Please download a proper newsreader (even Outlook Express will do if
you're desperate) and read the posts in their best form.
A proper newsreader will automatically quote the post you are replying
to, thus making it easier to understand what you are saying.

Then, to use the newsreader properly, quote only the bits you are
replying to, and reply below those bits.

This all may seem a lot of work to ask just one question, but it's
just the ways of Usenet groups, and you'll find much more information
if you follow those ways, than if you don't.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 21 '05 #3
<et*******@hotmail.com> wrote:
Hi,

I have a problem to get this working on Opera 7.x+. This does not need
to work on older Opera browsers

There are problems on rendering the sub-level navigation. It aligns
right on Firefox and IE 6.
Sometimes there are also some problems on IE 5 or IE 5.5.

I would like the navigation to work like this:

* The menu item width should not be defined because it differs on every
language.

* The sub navigation item should be aligned to the mainmenu containing
the menu item. The problem with Opera
comes if we have more than one subnavigation items. The items aren't
aligned next to each other. Instead they are
aligned one item per line.
[Much snipped]
#sub_navi {
position:absolute;
left:0px;
top:25px;
margin:0;
padding:0;
list-style:none;
display:inline;
white-space:nowrap;
}


Put a border or outline on #sub_navi. How wide is it?
How should the <li> elements float inside it?
CSS2.1, chapter 10 (Visual formatting model details):

<quote>
10.3.7 Absolutely positioned, non-replaced elements

...

3. 'width' and 'right' are 'auto' and 'left' is not 'auto',
then the width is shrink-to-fit . Then solve for 'right'

...

Roughly: calculate the preferred width by formatting the content
without breaking lines other than where explicit line breaks occur,
and also calculate the preferred minimum width, e.g., by trying all
possible line breaks. CSS 2.1 does not define the exact algorithm.
Thirdly, calculate the available width: this is found by solving for
'width' after setting 'left' (in case 1) or 'right' (in case 3) to 0.

Then the shrink-to-fit width is: min(max(preferred minimum width,
available width), preferred width).
</>
When calculating the available width, 'right' is set to 0.
Since the parent element (or actually the nearest positioned
ancestor) is a rather narrow <li>, the available width for
#sub_navi becomes rather narrow. So you need to set an explicit
'width' (or a negative 'right') to fix this.

Maybe.

Your CSS has an ungodly amount (21%) of 'position', 'display'
and 'float' properties, and these parts of the CSS isn't exactly
light reading. Or not to me, anyway. :-)
--n
Jul 21 '05 #4

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

Similar topics

2
2332
by: Markus Mohr | last post by:
Hi, everybody, I have developed a very nice javascript-based navigation structure. My customer wants to have a flash film on his very first site which already has to have this navigation. And...
5
2971
by: Steve Pugh | last post by:
I've been playing with a CSS based layout at http://steve.pugh.net/vtt/ I thought this wouldn't be too tricky, but eventually had to use a combination of position: relative and float which is a...
16
3419
by: Vincent | last post by:
First, here is a page to help you figure out what I'm talking about: http://relinquiere.free.fr/test.html As you can see in the source of this page, the structure is the following : - a banner...
0
1567
by: Ned | last post by:
I am having trouble with a layout that I am trying to convert from table based layout to css based layout. I have included source code for a stripped down version. The problem is that when the...
3
1573
by: James Agnew | last post by:
Hello I'm trying to find a javascript/DOM navigation tree to use in a web-based content management system, to allow navigation of > 10,000 folders/files. The javascript (non-DOM) tree we...
5
3005
by: Ray | last post by:
Hi, I was wondering if anyone has any idea how this can be done. I am trying to show/hide navigation links based on server names or ip addresses. So if, someone visits a particular url/ip address...
2
2387
by: Eric Lindsay | last post by:
I have been trying to do a CSS liquid layout imitating a frame, using position: fixed for header, footer, and side navigation, and a fixed background image. Page is valid HTML 4.01 Strict, and is...
1
1443
by: Eric Lindsay | last post by:
Most of my old navigation links take the form <p> <a href ...> ... </a> <br> <a href ...> ... </a> <br> etc. I would like to change the navigation to lists. However I can not decide whether...
28
2650
by: laredotornado | last post by:
Hi, Surprisingly, I can't get the drop down menus to work on PC IE 6. If you roll over "PRODUCTS", normally a drop down menu appears (on Safari and Firefox), but on PC IE, nada. ...
0
7298
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
7366
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...
1
7017
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...
0
5610
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,...
0
4698
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...
0
3187
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...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
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 ...
0
406
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...

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.