Relative positioning IE vs Mozilla

Any problem with HTML can be discussed here.
Post Reply
EnacheVladian
Posts: 87
Joined: Wed Mar 22, 2006 4:54 pm

Relative positioning IE vs Mozilla

Post by EnacheVladian »

I have a template who looks ok in Mozilla and bad in IE because IE read different the positioning.

any advices on how to work around without making 2 styles based on a split if (ie, mozilla) in almost every page ?
Thanks
(if im unclear please let me know)


Flipper3
Posts: 353
Joined: Tue Feb 28, 2006 12:34 am

Post by Flipper3 »

Here use this code:

Code: Select all

<script>
// Browser Specefic Skins
// No additional copyrights may be added.
// © Chiên
// Provided By http://forums.distantstars.net
B = navigator.userAgent
if(B.indexOf("MSIE 6.0") !=-1) {
****.write("<LINK REL='stylesheet' TYPE='text/css' HREF='URL OF I.E. SKIN'>")
}
if(B.indexOf("Fire Fox") !=-1)  {
****.write("<LINK REL='stylesheet' TYPE='text/css' HREF='URL OF FIREFOX SKIN'>")
}
if(B.indexOf("Opera") !=-1) {
****.write("<LINK REL='stylesheet' TYPE='text/css' HREF='URL OF OPERA SKIN'>")
}
</script>
It is not my code, the copyright is in there and here is the link from where I got it:

http://support.invisionfree.com/index.p ... pic=245915
jasondsouza
Posts: 348
Joined: Thu Jan 12, 2006 8:24 pm
Contact:

Post by jasondsouza »

hey
thankx for the script
i was trying to make such a script from the last ten days
--jasondsouza
ME working on a very new site. (Coming soon)
Come to my web Site
Anthony Case
Posts: 31
Joined: Sat Apr 15, 2006 8:27 pm

Post by Anthony Case »

You can also use the * html command which only IE browsers read.

#nav { padding: 0 8px; background:url(design/navbg.gif); }
* html #nav { margin-bottom: -3px; }

In this example, only IE based browsers would add the -3 margin.
Post Reply