R
E
S
O
U
R
C
E
S
       Question Index      Products & Services      Contact Us      Links


WebHatchers will design & develop your site for you.
_______________________

Website Menu Heaven: side or top popup menus, buttons, image rotators, navbars, tons more.
_______________________

Send us your questions and wittiest comments.
_______________________

Report errors on our site.
_______________________

Share your neatest DHTML examples with us; we may publish them.
_______________________


_______________________

      QUESTION INDEX      

Question Index
Browser Insanity
JavaScript
Animation
Buttons and Menus
CSS and HTML
PHP
Personal Status Boards
Content Management
   Systems
Website Directory
   CMS Systems


 INFORMATIVE ARTICLES 

Menus-and-Buttons-
Part-I.htm


Menus-and-Buttons-
Part-II.htm


Change-Div-Size-Color-
and-Location-with-the-
W3C-DOM.htm


Bouncing-Ball-Animation-
with-the-W3C-DOM.htm


Style-Changes-with-the-
W3C-DOM.htm


Animation-with-the-
W3C-DOM.htm


Window-Play-and-Some-
Important-DOM-Methods.htm


Using-getElementsByTagName
-and-getElementsByName.htm


The-CSS-Resources-Intro-
Page.htm


Convert-Word-Files-to-HTML-
and-Install-Editor2-to-
Use-Instead-of-NotePad.htm


CSS-Issues.htm

What Are Fifteen Simple Methods of Doing Web-Page Pop-ups?

Security levels from Javascript and PHP input filtering

What is a regular expression general input validator?

What is a regular expression user name validator?

What is a regular expression password validator?

What is a regular expression email validator?

What is a regular expression URL validator?

How can I convert a Javascript array to a PHP array?

How can I Dynamically Create Input Boxes with Validation?

How do I use JavaScript Object Notation (JSON) in PHP and JavaScript to convert strings and arrays from PHP to JavaScript?

How do I add html to a web page with JavaScript, PHP or ssi includes?

How do I add html to a web page with JavaScript includes?


PHP

How do you put PHP variables in URL and link text?

What is PHP Code for Multiple PSB Hosts?

What is Registration PHP Code for Multiple PSB Hosts?

What is Registration PHP Code for Multiple PSB Hosts with a captcha?

What is Administrator PHP Code for Multiple PSB Hosts?

What's the PHP code for a script for a PSB?

What's the PHP code for a script for PSB updating?

What's the PHP code for a script if you forgot your user name?

What's the PHP code for a script if you forgot your password?

What's the PHP code for a script to change a member's email address?

What's the PHP code for a script to connect to a MySQL database?

What's the PHP code for a script to close a member's account?

What's the PHP code for a script to edit group member?

What's the PHP code for a script to add group member?

What's the PHP code for a script to reset a MySQL table's data to its original?

What's the PHP code for a script to edit a MySQL table's data?

What's the PHP code for a script to change a username?

What's the PHP code for a script to change a password?

What's the PHP code for a script to delete group member?

What's the PHP code for a script to view membership data?

What's the PHP code for a script to change an administrator's password?

What's the PHP code for a script to logout?

What's the PHP code for a script to login?

Security levels from Javascript and PHP input filtering

Security levels and PHP

How can I convert a Javascript array to a PHP array?

What is PHP Code to Prevent Duplicate Data Input - Like User Names or Members?

What is PHP Code for PSB Status Update for Multiple PSB Hosts?

How do I sort 1 PHP array and have the other arrays sort in parallel to how the first array sorts?

How do I use JavaScript Object Notation (JSON) in PHP and JavaScript to convert strings and arrays from PHP to JavaScript?

How do you do PHP-to-JavaScript String Conversion with No JSON?

How do you Convert PHP String to JavaScript String?

How do you Post a JavaScript Array to a PHP Array?

How do you send a value to PHP using JavaScript?

Info on unwanted primary field auto-sorting

How can I do instant article font size, font family, and paragraph formatting with radio buttons?

How can I create custom HTML tags that are safer for MySQL databases?

How can I edit text from MySQL databases by using a textarea box?

How can I highlight matched search terms in a MySQL database table search?

How can I search using not only exact phrase matching but also a series of words to match in a MySQL database table search?

What's the code for an Ajax and PHP Based Input Filter?

Ajax and PHP Based Insult Auto-Completer

How can I use PHP and MySQL for Checking Key Codes to Allow Update to a New Software App Version?




Personal Status Boards (PSB™)

Standard Free PSB

PSB Pro Version

Social PSB

Social PSB Plus (with Email)

Business PSB

Business PSB Plus (with Email)

PSB demo

Social PSB demo

Business PSB demo

So what's all this PSB stuff about?

Chart comparing business status boards

PSB hosting diagram

PSB Licence Agreement




Article Content Management System

Content Management System Introduction

Content Management System—Article Navigation

Content Management System—Article Indexing

Content Management System—Article Editing

Content Management System—Article Searching

Content Management System—Article Deleting

Content Management System—Article Writing

Content Management System—Article Reading

What are the terms of use for our Article Content Management System?




Website Directory Content Management System

Website Directory—Delete Category

Website Directory—Delete URL

Website Directory—Add URL

Website Directory—Add Category

Website Directory—Directory Creating

Website Directory—View by Category (Demo Code)

Website Directory—View by URL (Demo Code)

Website Directory—View by Category (Demo)

Website Directory—View by URL (Demo)

Website Directory—View

Website Directory—View (Demo)



Copyright © 2002 -
MCS Investments, Inc. sitemap

PSBs, social networking, social evolution, microcommunities, personal status boards
PSBs, social networking, business personal status boards
website design, ecommerce solutions
website menus, buttons, image rotators
Ez-Architect, home design software
the magic carpet and the cement wall, children's adventure book
the squirrel valley railroad, model railroad videos, model train dvds
the deep rock railroad, model railroad videos, model train dvds

The Browser Display Issue

Many web programmers have been annoyed at the differences between the way IE and Netscape display div borders and margins, and this is often called the IE Box Model Problem. The W3C specs and Netscape say to add borders and padding to our div boxes, but IE (in the normal quirks mode in IE6 and in all IEs before IE6) doesn't (we like IE's quirks way best). You may be tempted to get one of those long JavaScript routines off the Net that will force sites to display Netscape and IE the same, since they don’t do it otherwise. In our opinion, it isn't worth it: there are just too many things that can go wrong. Better to design web pages that allow enough room for browser display variations. And feel free to use a browser sniffer for specific objects like the button we had to resize on our atest-buttons-and-menu-tests.html page. The resizing was for Netscape only because they insist on following W3C specs, which they technically should, but we'd have liked to see everyone do it the IE way and the W3C get forced to change their spec, since it's clumsy to work with. The adding of borders and padding to the stated box size (so that you'll often need to refigure your box size in practice—see code below) is what you'll often do with the "correct" box model. It's kind of like always knowing when to use the word "whom" correctly. Most people avoid the damn word because it's hard to get it right and not worth the effort. How many people do you know who use it a lot? See what we mean?

Okay, now, here's the rest of the story. In quirks mode (doctype) all IEs get the box model wrong, but from IE6 on the strict mode (doctype) gets the box model right. But in December 2003, when we wrote this, 62% of people were using IE6 but 32% were still using IE5 or IE5.5! So if you write for strict mode IE6 your W3C-compliant box model handling will be right only 62% of the time and wrong 32% of the time because using the strict doctype isn't going to magically change browsers from IE5 to IE6! A strict (a.k.a. standard) model (with borders and padding outside the stated width) is good to know about, but knowing when to write for it isn't so easy. Perhaps waiting until the combined IE5 and IE5.5 usage is below 1%, like IE4 (and NN4) is now, is the best time to "go strict." There seems to be as many opinions on this as there are web programmers.

And finally, let's take a peek at the nested div work-around. It's smart strategy and a good idea, when needed. All that's required is that you put all your divs inside other divs and declare the width and margin properties for the outer div only and the border and padding for the inner div only! The main thing to remember that's weird here is when you are giving the width of that outer div, add width + left padding + right padding + left border + right border and use the sum of these as your outer div width. So for a box with padding of 20 and border of 10 and width (the "contents") of 250, make sure that 250+20+20+10+10=310 is the width that you declare instead of 250. This will make your page work in IE5, IE5.5, IE6, Netscape6+, Opera, Mozilla, etc., We're all for this if you're dealing with thick borders or padding and the page you're designing needs this to look right on both IE and Netscape. Since Netscape6+ has the same W3C-compliant box model as strict doctype IE6, if you have IE6 you need to go back and forth from strict to quirks mode to check out your page. But why mess with doctypes when keeping around a computer with IE5.5 on it means that in any doctype you'll still have the box bug to test against? We keep a 5.5 and a 6 here.

The part of the code that's red below is dealing with a colored div button with a width of 72. Netscape7 is adding the 1-pixel-thick border to it (padding is 0) and making the div 74, so we're telling Netscape we lied and the width is only 70 so when it adds 2 for the border it gives us the 72 we wanted in the first place. Since we can do that for every div on the page or a selected group with just a simple for loop (as long as the divs have sequentially addressable id names like a1, a2, a3 . . . a43), we have to ask ourselves: Isn't this a lot easier than making outer divs to surround our normal divs and splitting up property declarations and calculating new widths everywhere?

function startmouse() {if(Netscape) {document.captureEvents(Event.MOUSEMOVE);document.getElementById('id54').style.width=70;}

document.onmousemove=getCoords;

}