Forum Moderators: not2easy

Message Too Old, No Replies

What does w\idth: 760px; mean...?

         

mumford

11:25 am on Mar 8, 2005 (gmt 0)

10+ Year Member



Hi

Could someone explain what this means and what it does, i'm presuming its a hack for an IE browser!

\width: 780px;
w\idth: 760px;

Thanks

createErrorMsg

1:37 pm on Mar 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



\width: 780px;
w\idth: 760px;

I've never seen this hack with the first backslash (\width) like your has. Without it, it is PART of a box model hack that delivers one width value to IE5.x (which uses the Quirks box model and packs padding and border inside of a box's width) and the second to IE6 in Standards mode (when the page has a valid doctype), which uses the standard box model that adds padding and borders to the outside of the box.

The full hack looks like this...

#YOURSELECTOR {
width:760px;
padding:10px;
}
/* start iemac hide \*/
* html #YOURSELECTOR {
width:780px;
w\idth:760px;
}
/* end iemac hide */

The first #YOURSELECTOR delivers values to all browsers. The second one, which is hidden from IEMac, delivers only to IE browsers. All IE browsers get the first (780px) width setting. Then IE6 reads the second (760px) setting, but IE5.x can't read past the backslash and so ignores it.

The overall purpose is to get all browsers to display the page identically, despite the different box calculations being used by each one.

cEM

4css

2:06 pm on Mar 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is called the Modified box model hack. If you do a google on it, you should be able to find an explaination on it.

Also, it will come up with the simplified box model hack.