Forum Moderators: open

Message Too Old, No Replies

positioning hack for IE

         

Geoffrey james

7:51 am on Aug 28, 2006 (gmt 0)

10+ Year Member



hi experts,

can anyone provide me with a hack to slightly move a position of a div.

in all other browsers the item in question is centre as i want it, and about 5px from top (THIS IS HOW I WANT IT TO LOOK)

this is the css used

#navmenu {
float: left;
margin-left: 5px;
width: 178px;
height: 325px;
}

but in IE it is bang up against the right colum, and right up against the top too!

i want to bring it down 5px and move it left 9or get rid of the original margin-left: 5px; as used for other browsers.

can anyone provide some css that i can get ONLY IE to use, and how to tell IE to use that css.

cheers all

Geoff

tedster

5:23 pm on Aug 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you've looked for standard approaches and can't find one, it might be a job for IE Conditional Comments:

[msdn.microsoft.com...]

Geoffrey james

6:29 pm on Aug 28, 2006 (gmt 0)

10+ Year Member



could you tell me one or two standard approaches you would take, im new to css and developing hacks for different browsers so do not know where to start.

Geoff

tedster

7:07 pm on Aug 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here are some basic ideas. First, as in all cross-browser rendering problems, use the W3C Validators

W3C Validator - HTML [validator.w3.org]
W3C Validator - CSS [jigsaw.w3.org]

Trying to fix cross browser rendering issues when the mark-up has errors can be frustrating or even impossible.

Second, make sure that you have explicitly declared margins and paddings for elements used in the page, rather than letting any of them go to the browser's default which can vary from browser to browser.

And finally, use our CSS Forum [webmasterworld.com] for support -- we've got some world class CSS talent in there!