Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > css positioning design in IE Win all over the shop in Safari

css positioning design in IE Win all over the shop in Safari
Thread Tools
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Dec 8, 2004, 09:27 AM
 
As far as I can gather the fault lies in IE6 for WIN, as 'margin-left: 150px' looks just right in Safari. Looks more like 220px in IE.

Tried using the be kind to Opera hack, to no avail.

Surely this is such a common problem that there must be a solution documented somewhere.

?????
     
Forum Regular
Join Date: Apr 2003
Location: Toronto, Canada
Status: Offline
Reply With Quote
Dec 8, 2004, 09:52 AM
 
Can you post a link to the page in question?

IE is always annoying when it comes to margin and padding (not to mention :hover).
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Dec 8, 2004, 10:01 AM
 
If the pixel measurement is different, then that sounds like a screen-resolution issue more than a browser problem. The proportions are just about right for it, though I'm guessing that if you measured the width in IE it would come out to 200px.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Dec 8, 2004, 10:24 AM
 
Ok, try the 'Be nice to myself' hack that I apply liberally:-

1: Make sure the document validates as XHTML 1.0 or 1.1 No particular reason, just a good habit I like to stick with.
2: Add the <?xml version="1.0" ?> declaration at the top before the DOCTYPE. This forces IE to go into quirks mode, even if it's IE6. This is a good thing. It means IE5, IE5.5 and IE6 will all use the same rendering techniques on your page, so compatibility and consistency become much easier to control.
3: Wherever you have a block-level element in your document set to a specific CSS width and you also have padding and/or borders, apply two widths. E.g.

#mybox
{
padding: 10px 10px 10px 150px;
border: 1px solid black;
width: 400px !important;
width: 562px;
}

- this creates a div at the same width for both IE and non-IE PC browsers, taking into account the quirks mode method of measuring box widths. The !important declaration is also... well... important, because it forces compliant browsers to use that value in preference to the 'less' important one. The less compliant browsers correctly use the bottom one.

This 'hack' has the benefit of creating a very level playing field for your browsers, producing clean and unhacked CSS and is browser-independant (so ONE day in the far and distant future MSIE may even play nice!)

Cheers
Computer thez nohhh...
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Dec 8, 2004, 12:19 PM
 
Wow, hadn't seen that "!important" trick in my travels.

Putting my feet up at the moment, but will be tweaking away first thing in the morning.

-thanks
     
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status: Offline
Reply With Quote
Dec 8, 2004, 01:40 PM
 
read everything you see at this site and dig it, daddio
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Dec 8, 2004, 02:39 PM
 
Excellent link Phil, bees knees, thanks.

Did you know that you used to be a rather famous media personality in NZ?
     
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status: Offline
Reply With Quote
Dec 8, 2004, 02:49 PM
 
Originally posted by skalie:
Did you know that you used to be a rather famous media personality in NZ?
i seem to be in more places than i'd care to be, once people know my name. what's the NZ story then?
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Dec 8, 2004, 03:37 PM
 
Nothing bad, he just happenned to be a news reader on the telly in my youth.
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Dec 9, 2004, 06:13 AM
 
OK, time to come clean, I bottled out, and have reworked the page in a table based layout.

Mistake #1, do not use IE6 for Win on your first attempt at making a fully css positioned website.

It would have been OK if I had developed the site using an honest browser and then chased the bugs in IE6, but backward-engineering a site built around IE6 bugs is not an option, rather start from scratch and get it right. Next site then.

Not a biggy, after the intro pages the site moves on to flash anyhows.

Thanks for the helpfull tips and links, all have been filed away for the next attempt.

A new quirk I just discovered with IE6, putting a <center> tag outside, well everything, centers averything on the whole page, including things in nested tables. I'm sure that wasn't the case with earlier versions of the browser.
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Dec 9, 2004, 06:20 AM
 
Originally posted by skalie:
OK, time to come clean, I bottled out, and have reworked the page in a table based layout.


If you like when it goes live, point a link to it and we can give a few pointers as to how it could be reworked

Good luck
Computer thez nohhh...
     
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status: Offline
Reply With Quote
Dec 9, 2004, 01:42 PM
 
Originally posted by skalie:
Mistake #1, do not use IE6 for Win on your first attempt at making a fully css positioned website.
i work to Firefox, at work (on a pc), and then fix things up for IE 5.0, 5.5, and 6.0 - i don't remember ever having to fix a glitch for Safari.
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Dec 9, 2004, 01:47 PM
 
Originally posted by Phil Sherry:
i work to Firefox, at work (on a pc), and then fix things up for IE 5.0, 5.5, and 6.0
If only I'd had that tip three days ago.
     
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status: Offline
Reply With Quote
Dec 9, 2004, 02:27 PM
 
Originally posted by skalie:
If only I'd had that tip three days ago.
lesson: learned. you know, next time.

i'm sure we all have our own quirky ways of seeing a project through. that's just one less headache, for me.
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Dec 9, 2004, 03:04 PM
 
You know, I'm very tempted to have a second shot at it tomorrow, using Firefox.

Then when everything goes haywire in IE6 for windows ( standards for the place where I work ), exclaim......... "But it works on every other browser known to mankind !!!!!!".

Then again, I want to keep my job.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:24 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2