5 replies [Last post]
matte
matte's picture
Offline
Enthusiast
Last seen: 12 years 10 weeks ago
Joined: 2004-03-18
Posts: 142
Points: 0

Trying to be a good boy, and avoid tables.

Trying to make two navbars (left and right aligned). Browser issues are making me nuts. Also need to know how to make a div height consistent across browsers. Experts, please see example:

http://home.comcast.net/~shoqaffect/tests/divs-oppalign.html

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 day 4 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Wrapping Navbars and consistent div heights

Hi matte,
There's a few things you should do that will help.
Firstly fix the typos Smile

Quote:
div#nav_r {float:right; 8px;height:20px;
whats the 8px; doing.
Also you should use the same case for the class names in the css as you use when declaring them in the tag. check out nav_R to see what I am talking about.
Then change the document from quirks to standards mode by adding a standards mode doctype, you will find heaps about this on the forum.

Lastly containers don't really know how big a float inside them is so set the height of box to something other then auto, try 30px for example.

Hope that helps

matte
matte's picture
Offline
Enthusiast
Last seen: 12 years 10 weeks ago
Joined: 2004-03-18
Posts: 142
Points: 0

Wrapping Navbars and consistent div heights

Thanks Tony!

Darn, and I thought I checked for typos pretty carefully. It's always those lost minute fixes where you create new ones.

I will check out standard doc types forthwith. I did try to find this, but of course, I didn't know just what topic to search for, so results were chaotic. Let me try these things and I will change the demo and see how it looks.

matte
matte's picture
Offline
Enthusiast
Last seen: 12 years 10 weeks ago
Joined: 2004-03-18
Posts: 142
Points: 0

Wrapping Navbars and consistent div heights

Ok tony. All typos and case issues fixed, and the right doctype spec added. I also changed the background div to 100%. Behaves as expected in IE and Opera, but still wrong in Moz. Is there any way to solve this?

http://home.comcast.net/~shoqaffect/tests/divs-oppalign.html

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 day 4 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Wrapping Navbars and consistent div heights

Hi matte,
Can you explain the problem you experience in Moz.
Is it the horizontal scoll bar or the way the floats wrap at smaller screen size.

If its the scroll bar try removing the width value on box.
Block elements in normal flow take up the whole line anyway.

Hope that helps

matte
matte's picture
Offline
Enthusiast
Last seen: 12 years 10 weeks ago
Joined: 2004-03-18
Posts: 142
Points: 0

Wrapping Navbars and consistent div heights

Tony wrote:
Hi matte,
Can you explain the problem you experience in Moz.
Is it the horizontal scoll bar or the way the floats wrap at smaller screen size.
If its the scroll bar try removing the width value on box.
Block elements in normal flow take up the whole line anyway.
Hope that helps

The problems are pretty much how I describe them on the site, in detail.
The thing I would like to achieve, is two inner bars within a container div. When the browser shrinks, the right bar drops down under the left bar. But the div has to grow in height as it does. This is the big desire. But related to this is how you can ever make a container expand as the content grows, when the content isn't actually in the background div, but in an inner div A friend says that mozilla is actually behaving to spec, and IE is trying to achieve what they think is pleasing. I just would like to learn how to solve the problem without tables. It seems it should be doable.