|
www.siteExperts.com
Inside Dynamic HTML | Forums | Fun and Games | HTML Online | Reviews Online | Resources Write Once! | DHTML Toolkits | Inside Techniques | Inside Scriptlets | Inside IE 5.0 | Search DHTMLLib/ CSS-Positioning/ Default Width Demonstration |
Below is an absolutely positioned DIV that has no width specified. Depending upon whether you are running Internet Explorer or Netscape Navigator, the default width of the element will be different:
In the above example no width is specified. Internet Explorer sizes the positioned DIV to the right edge of the window. Netscape Navigator sizes the positioned DIV to the size of the contents. A cross-browser solution is to position a table element instead. In addition, adding cellspacing=0 and cellpadding=0 to the table causes the spacing to be almost exactly the same. Without the additional attributes, Netscape ignores the default values of these attributes while Internet Explorer honors them causing Internet Explorer to take up slightly more space.
| Default Width Demo |