473,385 Members | 1,720 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,385 software developers and data experts.

Another IE vs Mozilla problem (simple fix?)

Having a hard time getting a navigation bar looking the same in IE and Firefox.

The test html file:

http://jonathanwayne.com/navbar/testnav.html

Main style sheet: http://jonathanwayne.com/navbar/testnav.css

To override properties that are handled differently in IE, I use
http://jonathanwayne.com/navbar/testnav_ie.css

Note how thick the "navspacer" (solid line dividing categories) is in IE. I
can't seem to get it any thinner. The height is defined as 3px, but even if I
make it 1px in the IE css file, it doesn't get any thinner. (I can make it
thicker.)

Easy fix? Dumb mistake? Help greatly appreciated!

jon
--
jw@nospamforme.com
Jul 27 '05 #1
5 1834
The gratuitous vert space that IE seems to insert if I mention either
width or height explicitly has looked to me somehow related to
font-size. So to get around the problem, I say:

..navspacer
{
width: 215px;
height: 3px;
font-size: 0;
background-color: #000099;
}

hth -- pete

Jul 27 '05 #2
Once upon a time *p***@pwilson.net* wrote:
The gratuitous vert space that IE seems to insert if I mention either
width or height explicitly has looked to me somehow related to
font-size. So to get around the problem, I say:

.navspacer
{
width: 215px;
height: 3px;
font-size: 0;
background-color: #000099;
}


Why are you writing a new message with the "Re:" in front of the
subject? If you are responding to an other, please read my sig!

--
/Arne

Top posters will be ignored. Quote the part you
are replying to, no more and no less! And don't
quote signatures, thank you.
Jul 27 '05 #3
pe**@pwilson.net wrote:
The gratuitous vert space that IE seems to insert if I mention either
width or height explicitly has looked to me somehow related to
font-size.


font-size is not the problem. line-height is, combined with IE's broken
default overflow behavior. For example, to set an element height to 1px,
you need to set overflow:hidden to prevent the automatic height
expansion to one full line.

However, you should reconsider the need to define such elements in the
first place. A 1px high element might be better off set via a top or
bottom border property instead. There is always more than one way to
accomplish something. Why code extra elements in HTML when they aren't
really needed?

BTW, either get yourself a real newsreader and dump google groups for
posting to usenet, or learn how to enable quoted replies. Either way,
use accepted posting practices or you may just end up in killfiles
everywhere.
<URL:http://allmyfaqs.com/faq.pl?How_to_post>

Your best bet is to dump google because lots of people already killfile
anything that comes out of it.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 27 '05 #4
On Wed, 27 Jul 2005 10:11:15 -0500, kchayka <us****@c-net.us> wrote:
font-size is not the problem. line-height is, combined with IE's broken
default overflow behavior. For example, to set an element height to 1px,
you need to set overflow:hidden to prevent the automatic height
expansion to one full line.
Thanks. Both the font-size and the overflow suggestions work. I'm using
kchayka's overflow suggestion as it seems more syntactically correct.

http://jonathanwayne.com/navbar/testnav.html
However, you should reconsider the need to define such elements in the
first place. A 1px high element might be better off set via a top or
bottom border property instead. There is always more than one way to
accomplish something. Why code extra elements in HTML when they aren't
really needed?


Using the navspacer class seems more straightforward since as a bottom
border it is sometimes below a category header and sometimes below an item.
Or as a top border it is always above a category except for the top
category, but it's also a bottom border below the bottom category. (In this
example.) So at a minimum, I'd still have to setup additional category
header classes, no?

jon
Jul 27 '05 #5
JonW wrote:
On Wed, 27 Jul 2005 10:11:15 -0500, kchayka <us****@c-net.us> wrote:
A 1px high element might be better off set via a top or
bottom border property instead. There is always more than one way to
accomplish something. Why code extra elements in HTML when they aren't
really needed?


Using the navspacer class seems more straightforward since as a bottom
border it is sometimes below a category header and sometimes below an item.


FYI, the accepted norm for semantic navigation menu markup, especially
those menus styled via CSS, is a (nested) list. There are plenty of
sites that show how to do it. Google for listamatic or list-o-matic for
several examples. One of those sites even generates some sample code for
you.

In nested list markup you'd likely use a bottom border on the parent
list item, but not the child lists. It's not hard.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 27 '05 #6

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

Similar topics

5
by: Patrick Stone | last post by:
Here's a reason why javascript sucks so bad. The following *SIMPLE* piece of code will not work properly. Jesus, how I yearn for the day when a real programming language can be substituted for this...
10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
3
by: Clarence Gardner | last post by:
I'm seeing surprising behavior, consistent across Opera, Firefox, and IE. An event handler is changing the value of an element, and there is apparently no Change event being generated for the...
5
by: niftyhawk | last post by:
Hi, Can anybody give me a simple example of how to Call Web Services from Mozilla based Browsers ? I can call web services from IE browser using web service behavior file, without any problems....
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
5
by: Jonel Rienton | last post by:
Hi, i've created a simple web application and throw in some labels, textboxes and requiredfield validators in there. during my testing using different browsers, i've noticed that when i was...
5
by: Asterbing | last post by:
Hello, Here is a page which contains an "evoluated" (to distinguish-it from the simple one) way to hear sound on a html page event. From my memory, it worked under all major browsers, but didn't...
20
by: Thorsten Kampe | last post by:
Hi, I've already sent this to the Komodo mailing list (which seemed to me the more appropriate place) but unfortunately I got no response. I'd like to build a Python GUI app. Neither Tkinter...
3
by: PrabodhanP | last post by:
I have CSS based mouseover scrolling for divContent embeded in my webpage.It works fine in IE,but not working in mozilla-FF. It is located at the location.....
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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,...

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.