Single row navigation menu

P

Paolo

Hello,
on the top right side of my page, I've a 4 elements navigation menu
that is css formatted
<ul>
<li>...</li>
.
.
<li>...</li>

</ul>

When I resize the window in *width* (x axis) the last element is moved
to a second row below the initial one, creating problem to the rest of
the fluid layout. How can I fix that, making sure that after a certain
point the scrollbar for the width appears allowing to scroll rather
than sending the last element to the next row? In other words, how can
I make sure the navigation menu is not broken into multiple lines when
I resize the window?

thanks,
Paolo
 
W

wayne

Paolo said:
Hello,
on the top right side of my page, I've a 4 elements navigation menu
that is css formatted
<ul>
<li>...</li>
.
.
<li>...</li>

</ul>

When I resize the window in *width* (x axis) the last element is moved
to a second row below the initial one, creating problem to the rest of
the fluid layout. How can I fix that, making sure that after a certain
point the scrollbar for the width appears allowing to scroll rather
than sending the last element to the next row? In other words, how can
I make sure the navigation menu is not broken into multiple lines when
I resize the window?

thanks,
Paolo
Are you saying the menu is on one line from left to right and when you
make the width smaller, the item that exceeds the window width moves
down to a new line?

If so, you must format your elements so they do not exceed the allocated
minimum width. Perhaps your menu items text could be made shorter or
the menu "blocks" (padding?) may be too large.
 
J

Jukka K. Korpela

Scripsit Paolo:
on the top right side of my page, I've a 4 elements navigation menu
that is css formatted [and marked up as a <ul> element ]

Well, fine, but where's the URL so that we can see the CSS code (as well as
the problem in action).
When I resize the window in *width* (x axis) the last element is moved
to a second row below the initial one, creating problem to the rest of
the fluid layout.

Why would it create a problem to the rest of the fluid layout? What do _you_
mean by "fluid layout"? The way I see it, it includes the idea that the
content wraps to next line if it does not fit to the available horizontal
space.
How can I fix that, making sure that after a certain
point the scrollbar for the width appears allowing to scroll rather
than sending the last element to the next row?

So you want non-fluid layout? At least in this respect. Think again. Now,
think _again_. Then reject the idea, and consider reducing the navigation
menu (it has too many items anyway), and also take the possibility of line
wrap inside it as a real possibility that _will_ materialize at times
(though not often if you make the menu reasonably small).
In other words, how can
I make sure the navigation menu is not broken into multiple lines when
I resize the window?

It depends on how you have written your CSS code for formatting the menu.
However, my crystal ball says that you would need to add

ul#navmenu { white-space: nowrap; }

You might have some other id="..." value instead of "navmenu". And my
crystal ball _has_ been wrong. (I think it was in 1998.) Besides, this was a
wrong thing to want.
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Sun, 15 Jul 2007 04:42:29 GMT
Paolo scribed:
Hello,
on the top right side of my page, I've a 4 elements navigation menu
that is css formatted
<ul>
<li>...</li>
.
.
<li>...</li>

</ul>

When I resize the window in *width* (x axis) the last element is moved
to a second row below the initial one, creating problem to the rest of
the fluid layout. How can I fix that, making sure that after a certain
point the scrollbar for the width appears allowing to scroll rather
than sending the last element to the next row? In other words, how can
I make sure the navigation menu is not broken into multiple lines when
I resize the window?

Lots of ways to do that, but then it wouldn't be fluid.

If you still insist, explore the css quality of "white-space:nowrap;"
 
P

Paolo

Hello,
the page is not online yet, I'm still working on it.

This is the css code

..nav-top-menu
{
font-family: Arial, sans-serif, 10%;
margin-top: 1%;
margin-left:12%;
}

..nav-top-menu ul
{
list-style: none;
padding: 0;
margin: 0;
text-align:center;
}

..nav-top-menu li
{
float: left;
margin: 0 0.15em;
}

..nav-top-menu li a
{
height: 3em;
line-height: 2em;
float: left;
width: 7em;
display: block;
color: #0d2474;
text-decoration: none;
text-align: center;
}

..nav-top-menu li a span
{
color: white;
text-decoration: underline;
font-style: italic;
font-weight: bold;
font-size: 1em;
}

and here the html code

<div class="nav-top-menu" width=100% >
<ul>
<li><span>Item1</span></li>
<li><span>Item2</span></li>
<li><span>Item3</span></li>
<li><span>Item4</span></li>
</ul>
</div>

Thanks!
Paolo
 
P

Paolo

Scripsit Paolo:


So you want non-fluid layout? At least in this respect. Think again. Now,
think _again_. Then reject the idea, and consider reducing the navigation
menu (it has too many items anyway), and also take the possibility of line
wrap inside it as a real possibility that _will_ materialize at times
(though not often if you make the menu reasonably small).

it materializes only when the window is becoming too small, in most of
the cases it works just fine. In those situations (and only in those),
I'd like to enable the width scrollbar at the bottom of the window.

thanks,
Paolo
 
P

Paolo

Scripsit Paolo:


So you want non-fluid layout? At least in this respect. Think again. Now,
think _again_. Then reject the idea, and consider reducing the navigation
menu (it has too many items anyway), and also take the possibility of line
wrap inside it as a real possibility that _will_ materialize at times
(though not often if you make the menu reasonably small).

it materializes only when the window is becoming too small, in most of
the cases it works just fine. In those situations (and only in those),
I'd like to enable the width scrollbar at the bottom of the window.

thanks,
Paolo
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Sun, 15 Jul 2007 18:10:56 GMT
Paolo scribed:
Hello,
the page is not online yet, I'm still working on it.

This is the css code

Try adding width:28em; to .nav-top-menu ul.*

* Opera bug.
 
J

Jukka K. Korpela

Scripsit Paolo:
Hello,
the page is not online yet, I'm still working on it.

If you can't be troubled to upload your best effort so far, don't expect
people to spend their time to help you. Bye.
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Mon, 16 Jul 2007 06:45:20 GMT
Jim Moe scribed:
Have you actually tried that? It does not work.

No, not with floats. I followed-up with another solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top