PDA

View Full Version : IE7 wierdness?


nerd
03-08-2007, 04:34 PM
Hello,

I'm working on my site again, but seems to run into a strange problem with IE.
If you check out the following link and compare IE7 to Firefox you will see what I mean. The position of my menu is slightly off... can't figure out how to solve this..

Any help would be appriciated!

my site (http://www.macfacts.org/cae_new/development/start.html)

K_TempesT
03-08-2007, 05:35 PM
Perhaps you fixed it... perhaps I just can't tell the difference though. I don't see any problems.

-KT

Pegasus
03-08-2007, 10:07 PM
How do you mean "slightly off"?

Peg

nerd
03-09-2007, 05:14 AM
If you hover over my buttons in the menubar you will see that in IE7 the position is lower then in Firefox! I use IE7 and sadly enough I did not solve this yet! :(

Pegasus
03-09-2007, 07:49 AM
Try adding a 1px border to your hovers. That might do it.

Peg

Excavator
03-09-2007, 10:41 AM
Hello nerd,
I can see a lot of problems here, most caused by your main image not being a background image. Negative margins can cause you trouble too...

I re-ordered some stuff in your html and totally changed your CSS. It works much better...
Have a look:
markup:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML>
<HEAD>
<TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="start_files/stylesheet.css" type=text/css rel=stylesheet>
</HEAD>
<BODY>
<DIV id="wrapper">
<DIV class="topmenu">
<UL>
<LI><A href="http://www.macfacts.org/cae/profiel.html">Profiel</A></LI>
<LI><A href="http://www.macfacts.org/cae/projecten.html">Projecten</A></LI>
<LI><A href="http://www.macfacts.org/cae_new/development/">Kernwaarde</A></LI>
<LI><A href="http://www.macfacts.org/cae/contact.html">Vacatures</A></LI>
<LI><A href="http://www.macfacts.org/cae_new/development/" class="struct">PT Structural</A></LI>
<LI><A href="http://www.macfacts.org/cae_new/development/">Contact</A></LI>
<LI><A href="http://www.macfacts.org/cae_new/development/">Home</A></LI>
</UL>
</DIV>
</DIV>
<DIV class="footer">
<p>Postbus 9358 | 3007 AJ Rotterdam | tel: 010-4471744 | cae@cae.nl</p>
</DIV>
</BODY>
</HTML>


and the CSS:
BODY {
BACKGROUND-COLOR: #ccc
}
* {
margin: 0;
padding: 0;
border: none;
}
#wrapper {
MARGIN-LEFT: auto;
WIDTH: 979px;
height: 590px;
MARGIN-RIGHT: auto;
TEXT-ALIGN: center;
background-image: url(caegrid2007.gif);
background-repeat: no-repeat;
overflow: hidden;
}
.topmenu {
HEIGHT: 26px;
margin: 106px 0 0 228px;
FONT-SIZE: 13px;
FONT-FAMILY: Tahoma;
}
.topmenu ul a {
display: block;
width: 80px;
height: 28px;
}
.topmenu li {
float: left;
width: 80px;
height: 28px;
list-style-type: none;
text-align: center;
}
.topmenu li A:hover {
width: 80px;
height: 28px;
BACKGROUND: #c3e2f3;
COLOR: #000000;
}
.topmenu li A:active {
width: 80px;
height: 28px;
BACKGROUND: #c3e2f3;
COLOR: #000000;
}
A.struct {
BACKGROUND: red;
COLOR: black
}
.footer {
width: 979px;
margin: 0 auto;
FONT-SIZE: 13px;
COLOR: white;
FONT-FAMILY: Tahoma;
}

nerd
03-10-2007, 09:12 AM
Wow, thanks for the hard work! It looks great in firefox but in IE7 it's not centered anymore? Do you have any idea how this can be solved? Also I see that you deleted the relative positioning, why is that if I may ask... Want to learn from this! :)

Excavator
03-10-2007, 11:26 AM
Goodmorning nerd,
The code I posted centers in IE7 here.
Post your code or put it up on your test server so we can see what your doing.

As for deleting the positioning, there is rarely any need for it. Usually it causes more problems than it solves.

nerd
03-12-2007, 02:19 PM
Thanks for all the help..

I put the code online, still got IE7 problems with centering the site!
In firefox it works like a charm...

Maybe it's me, and yes it probably is! :)

http://www.macfacts.org/cae_new/development/start.html

Excavator
03-12-2007, 02:42 PM
Goodmorning nerd,
You need to use a correct DocType.

Read about doctypes in the link in my sig below.
Also read about validating
- the validator found the problem right away.
Here is your markup with a correct DocType:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<title>Untitled Document</title>
<LINK href="start_files/stylesheet.css" type=text/css rel=stylesheet>
</HEAD>
<BODY>
<DIV id=wrapper>
<DIV class=topmenu>
<UL>
<LI><A href="http://www.macfacts.org/cae/profiel.html">Profiel</A> </LI>
<LI><A href="http://www.macfacts.org/cae/projecten.html">Projecten</A> </LI>
<LI><A href="http://www.macfacts.org/cae_new/development/">Kernwaarde</A>
</LI>
<LI><A href="http://www.macfacts.org/cae/contact.html">Vacatures</A> </LI>
<LI><A class=struct href="http://www.macfacts.org/cae_new/development/">PT
Structural</A> </LI>
<LI><A href="http://www.macfacts.org/cae_new/development/">Contact</A> </LI>
<LI><A href="http://www.macfacts.org/cae_new/development/">Home</A>
</LI></UL></DIV>
<DIV class=footer>
<P>Postbus 9358 | 3007 AJ Rotterdam | tel: 010-4471744 |
cae@cae.nl</P>
</DIV>
</DIV>
</BODY>
</HTML>

nerd
03-12-2007, 03:21 PM
Thank you for you quick response... You are really very helpfull...
I think I got my main layout finished.. Need to add a few little things and I'm done!

I still wondering about the doctypes. I did some reading, but I can't figure out when to use the strict or when to use the transistional, like I do now..

Oh and I used some negative pixels, you said not to use them, if you have the time maybe you could show me how to do the footer trick without using the negative numbers! Thanks again, and if you are starting to get sick of me, please ignore me! ;)

Excavator
03-12-2007, 03:54 PM
I still wondering about the doctypes. I did some reading, but I can't figure out when to use the strict or when to use the transistional, like I do now..
I always use XHTML 1.0 Strict for anything I'm writing new. That way I'm sure to be using the most current stuff.
For older sites that are getting an upgrade/facelift that I don't want to completely re-write, I'll find an older, more compatable DocType.


Oh and I used some negative pixels, you said not to use them, if you have the time maybe you could show me how to do the footer trick without using the negative numbers! Thanks again, and if you are starting to get sick of me, please ignore me! ;)
Negative pixels are ok, when needed. Your site didn't need them though.
Here is an example of the footer trick using negative margins. (http://www.nopeople.com/CSS/full-height-3column/)

I'm not getting sick of you - I'm more than happy to help when I can!