Wednesday, 10 January 2007

Vertical positioning hack in css

Hi,

For those who have experienced a vertical postioning issue when using netscape or firefox:

The webpage may look perfect in IE but as you are all aware when it comes to CSS, IE lags behind Firefox and Netscape with regards to compatibility or support. More recently when developing or modifying an existing website which worked perfectly in IE but showed a vertical shift in other browsers, I discovered a simple hack to resolve the concern, insert the following,

within HTML:

,

where the class for "spacer" being defined as,

div.spacer { clear:both; line-height: 0; height: 0; border: none; margin-left: 0; margin-top: 0px; margin-right: 0; margin-bottom: 0;}

The above should eliminate the spaces, but if it doesn't, simply increase or decrease "margin-top" value to suit.

Hopefully that should be help.

www.nikkabokka.com

No comments: