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

Newbie Problem: Menu not aligned in IE6

it was perfectly in firefox but not getting right in IE.........
its css is.....
#region_header {
position:absolute;
left: 10px;
top: 2px;
margin: 0px;
padding: 0px;
width: 468px;
height: 20px;
border: none;
color: #fff;
}
Aug 21 '07 #1
9 2618
phvfl
173 Expert 100+
Hi,

This is possibly due to the differences in the box model between Firefox and IE. Check that the HTML validates and that you use a doctype so that IE is not in quirks mode.

If these do not help please submit either a URL where the problem can be seen or the HTML so that the problem can be reproduced
Aug 21 '07 #2
http://ebizontech.vpsland.com/menu_t...efox/page.html in the link you can see the difference......................in firefox and IE.............please help me
Aug 21 '07 #3
phvfl
173 Expert 100+
The page currently has 26 errors. The validation result can be seen here

The PHP script does not seem to be working and your server side code for the screen printing is being sent to the client.

Fix these issues first, I will continue looking at this to see if there are any other issues that I can see.
Aug 21 '07 #4
phvfl
173 Expert 100+
Having looked at the source code, the reason that the PHP code is not executing is because the opening and closing tags ("<", ">") are being URL/HTML encoded so they are not being parsed correctly on the server side and therefore not being executed
Aug 21 '07 #5
The page currently has 26 errors. The validation result can be seen here

The PHP script does not seem to be working and your server side code for the screen printing is being sent to the client.

Fix these issues first, I will continue looking at this to see if there are any other issues that I can see.
Thanks phpvfl. I have valided my html agains the validator of w3 and have also removed all php codes. Now please help to get the menu items working on IE. (it is working with firefox).
http://ebizontech.vpsland.com/menu_test/spreadfirefox/page.html
Aug 21 '07 #6
phvfl
173 Expert 100+
Hi,

I have managed to determine that the absolute positioning on the ul is not being applied the same in FF and IE, however it is going to take some time to determine the active styles on the tabs due to the amount of CSS. There are 23 different selectors that match with the tabs (granted this is including inheritance), so it will take some time trying to get my head around this.
Aug 23 '07 #7
JamieHowarth0
533 Expert 512MB
Hi there,

This is a fairly simple solution which I use in my websites - I copy my base stylesheet (style.css) and rename it with a two-digit browser identifier (so style_ie.css would be for Internet Explorer, style_ff.css for Firefox etc.).

Then you use some Javascript to identify which browser the client is using and subsequently insert the relevant <link> tag into your page (like below:)
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. <!--
  3. switch (navigator.appName.substr(0,5)){
  4.     case "Micro":    
  5.         document.write('<link rel="stylesheet" type="text\/css" href="style_ie.css" \/>');
  6.         break;
  7.     case "Netsc":
  8.         document.write('<link rel="stylesheet" type="text\/css" href="style_ff.css" \/>');
  9.         break;
  10.     case "Opera":
  11.         document.write('<link rel="stylesheet" type="text\/css" href="style_op.css" \/>');    
  12.         break;
  13.     default:
  14.         document.write('<link rel="stylesheet" type="text\/css" href="style.css" \/>');
  15.         break;
  16. }
  17. //--></script>
The problem I generally find is that FF and IE are about 5 pixels horizontally and 3 pixels vertically out of sync with each other (which isn't surprising lol) - however Opera, funnily enough, is almost identical to IE!
If you're using script in your page, you should also export your JScript to separate files and use this section to import that script for different browsers (such as image/menu rollovers, AJAX etc.).

Note the default option - should your script not recognise the user's browser (for example, some specialist screen reading browsers - or maybe just Lynx lol), your page serves up a stylesheet (and JScript if you should so choose) that conforms to the W3C CSS2 classification, covering your bases.

Hope this helps!

medicineworker
Aug 23 '07 #8
drhowarddrfine
7,435 Expert 4TB
Differences in spacing around elements are sometimes caused by different default margin/padding between browsers. It is frequently best to set all margins/padding to zero in CSS and then set each element individually to what you want.
Aug 23 '07 #9
phvfl
173 Expert 100+
Hi,

I think that the problem that you had was that each level of the DOM had positioning associated with it and due to the way that inheritance is applied in each level the outcome was very different in each browser.

When designing the CSS start with broad strokes and then fine tune individual elements. Also keep checking in different browsers so that if discrepancies do occur then you know exactly what is causing them. Setting all padding and margins to 0 is something that I do whenever I am using CSS as it gives more control over the page across browsers, I also tend to remove borders from images that are children of anchors as by default they get a blue border.

I have (almost) managed to recreate the page which is standard across all browsers. For comparison the size of the CSS is under 2K compared to 35K. The only difference to the HTML is that the tabbed links at the top are now:
[HTML]
<li class="navbut4"><span>&nbsp;</span><a class="b" href="popular-news">Popular News</a></li>
<li class="navbut3"><a class="b" href="upcoming">Upcoming News</a></li>
<li class="navbut3"><a class="b" href="node/add/storylink">Submit News</a> </li>
[/HTML]
The classes are on the list items instead of the anchors, the span on the first tab has been moved outside of the anchor and the spans of the other tabs have been removed. The span has a space in it so that it does not collapse to nothing.

The CSS used is:
Expand|Select|Wrap|Line Numbers
  1. /*Remove all padding and margins*/
  2. *{padding:0;margin:0;}
  3.  
  4. /*general styles according to element types*/
  5. a img{border:none;}
  6. li{list-style-type:none;}
  7. body{background:transparent url(http://ebizontech.vpsland.com/menu_test/spreadfirefox/images/bg_head.gif) repeat-x;font-family:verdana, sans-serif;font-size:76%;}
  8.  
  9. /*general classes for repeated use*/
  10. .b{font-weight:bold;}
  11. .hide{display:none;}
  12.  
  13.  
  14. #wrapper{width:950px;margin:0 auto;}
  15.  
  16. /* top image styles*/
  17. #site-name{font-size:2.5em;}
  18. #site-name *{color:#FFFFFF;text-decoration:none;}
  19.  
  20. /*tabbed navigation styles*/
  21. .cab li{float:left;margin:0 0.5em;}
  22. .cab a{padding:0 0.5em;position:relative;top:8px;color:#666666;}
  23. .cab a:hover{color:#774525;}
  24. .navbut4{background:transparent url(http://ebizontech.vpsland.com/menu_test/spreadfirefox/images/tabrightB.png) no-repeat top right;height:32px;}
  25. .navbut4 span{background:transparent url(http://ebizontech.vpsland.com/menu_test/spreadfirefox/images/tableftB.png) no-repeat;height:32px;float:left;}
  26.  
  27. .navbut3{background:transparent url(http://ebizontech.vpsland.com/menu_test/spreadfirefox/images/tabrB2.png) no-repeat top right;height:32px;}
  28. .navbut3 span{background:transparent url(http://ebizontech.vpsland.com/menu_test/spreadfirefox/images/tablB2.png) no-repeat;height:32px;float:left;}
  29. .navbut3:hover{background:transparent url(http://ebizontech.vpsland.com/menu_test/spreadfirefox/images/tabrightB.png) no-repeat top right;}
  30.  
  31. /*navigation styles*/
  32. #navbar{border-top:8px solid #F74594;background-color:#FFC3DE;padding:8px 0 8px 30px;clear:left;}
  33. /* Hack for IE6 position*/
  34. * html #navbar{padding-top:0;}
  35.  
  36. /*add bullets back to list item*/
  37. #navbar li{list-style-type:disc;padding:0;margin:0;}
  38.  
  39. /*footer styles*/
  40. #footer{border-top:1px solid #666666;text-align:center;font-size:0.8em;margin:2em 0;padding:1em 0;}
  41. #footer *{color:#666666;}
  42.  
The URLs for the images are absolute at present so these could be made relative again. The main differences in style are that the tabbed navigation does not overlap the site logo and that the tabs do not change background colour when hovered on in IE6. This is because IE6 only applies :hover to anchors, this could be corrected using javascript or adding more styling but as it works correctly in IE7 I would say that it acceptable as it is.

The tabs could be made to overlap the images, but this would start the issue of positioning and inheritance being applied differently so hacks would be required to make all browsers render the same.
Aug 26 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Marek Mand | last post by:
How to create a functional *flexible* UL-menu list <div> <ul> <li><a href=""></li> <li><a href=""></li> <li><a href=""></li> </ul> </div> (working in IE, Mozilla1.6, Opera7 (or maybe even...
3
by: Mark | last post by:
Ok, it is starting to get somewhere, but i am not sure what to do with the following problem: I designed "knobs". They are 90px in width and do have one border (right) of 1px. So i guess, within...
10
by: Adrian | last post by:
Hi simple question I hope!! Using the menu designer I have a file menu and an options menu with sub items... I have added a Help menu and want it on the right-hand side away from the other menu...
0
by: DaveC | last post by:
Hi Folks, Trying to display a two tier menu horizontally but not having any luck with the new menu control. The First Tier should display static horizontal. The Second Tier should display...
3
by: töff | last post by:
On my site http://www.sjcga.com I have a javascript-generated navigation menu in the top right corner. The menu works great in IE and Opera ... but in FireFox, on the 1st click, the menu jumps...
4
by: =?Utf-8?B?TWljaGFlbCBIYWJlcmljaHRlcg==?= | last post by:
Hi, I'm adding 5 ToolStrips to a ToolStripPanel (ToolStripContainer, TopContainer) and see them ordered in three rows, starting on the left side. I want to have it in one row all. Trying to join...
11
by: Daemach | last post by:
OK, it's time to try the experts :) I've been doing most of my development work in Firefox because of Firebug. Then, when my projects are fully debugged, sleek and refined I load them in IE and...
1
by: Emil | last post by:
Hello, I'm using asp.net 2.0. I have a horizontal menu control. The children menu items are center aligned when shown. How can I change the alignment of the dynamic menu items to be left aligned?...
8
by: jch | last post by:
Sorry for the newbie question but I'm trying to learn Visual Studio. I've got VS Express 2008 and I'm using visual basic. I'm trying to learn how to deploy a program so I've written a very basic...
2
by: Jeff | last post by:
hi asp.net 2.0 I wan thte menu to be horizontally centered on the webpage, but I want the submenuitems to left aligned. So I created a table cell with HorizontalAlign set to Center. With this...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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...
0
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...

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.