/    Sign up×
Community /Pin to ProfileBookmark

2px equalling 3px in IE!!

Hey there,

I have yet another infuriating problem in IE with a web calendar I have made here: [url]http://www.mapledurham.co.uk/newsite/admin/bookings/calendar6.php[/url]

It works in Firefox and Netscape but in IE the divs which are generated to be a specific width by PHP are made broader some how so that the weeks have 5 days in them rather than seven! How IE manages to misunderstand what a pixel is I just dont know!

Anyone any ideas how to hack this problem?

Thanks
Dave

p.s. I can’t get the calendar to float beside the names in Opera either if anyone has any ideas…

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelJul 27.2006 — Yes, it's IE's faulty box-model errors. IE adds a few pixels for the values of border, margin and padding.

Always include the following in your html code. All compliant browsers do this by default, and they aren't affected by this.

<style type="text/css">

body, html {margin:0; padding:0; border:0;} /* Re-sets IE to "zero" for these values */

</style>
Copy linkTweet thisAlerts:
@dosullivanauthorJul 27.2006 — Yeah tell me about it its a bloomin nightmare but I am not sure thats whats causing the problem here as the divs don't have any of those attributes.

What seems to be happening is (for example) each day on the calendar is a div that is 2px wide and either background coloured blue or darker blue alternately. Unless the calendar is zoomed in each div has no content at all and no other attributes (unless its a booked block which has a border but I'll deal with that somehow...) Eveyone else thinks its ok to do what they are told and makes a div that is 2px wide. IE thinks its gonna be different and appears to be adding a pixel for no reason meaning that my days and weeks don't line up. Grrrr

any other ideas?
Copy linkTweet thisAlerts:
@WebJoelJul 27.2006 — I'm trying to validate this with HTML-Tidy on Firefox, -and it's just flippin' out on me. -Taking a minute or two to resolve the page, but when it does, I get some 40 warnings (errors), mostly things like "line 80 column 39 - Warning: missing </a> before </p>".

Basically, there is an implied implicit closure to a tag that is already open. This may account for some of the wait-time for the page to resolve.

Does it look okay to you on IE? I haven't viewed it yet with IE and can't really say how it is supposed to look from what I'm seeing with Fx. I am seeing text in the upper-lefhand corner of the browser window that says "Array()". If I'm seeing this in the page as part of the page it isn't doing anything for the code and that is probably a problem.
×

Success!

Help @dosullivan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...