Jump to content

well its wierd as hell have 2 diffranet resualts in IE and Firefox . from same..


yanivkalfa

Recommended Posts

i made a site it uses divs to place a text field inside a pic i have with an absolote positions.

now when i load the page with explorer it showes 1 resualt and on fire fox another resualt is there a way to fix it ?

 

#apDiv1 {
position:absolute;
left:337px;
top:125px;
width:250px;
height:12px;
z-index:1;
}

.one {
width: 200px;
height: 14px;
background:#FFFFFF;
border: none;
padding: 2px 0 0 5px;
}

 

and here is the body

<div id="apDiv1">
  <label>
  <input name="textfield" type="text" class="one" id="textfield" value="kjabskhdbaks" />
  </label>
</div>

 

dont know how to fix this if anyone have an idea i will kiss him and realy appriciate it . thanks in advanced :-)

Link to comment
Share on other sites

im not sure if this is what you mean, but i find that firefox and IE do not like to view CSS the same way.. heres what I do

 

 

create two style sheets, one that works in IE, and one that works in firefox (copy and paste.. make the minor errors... usually margins)

 

use the IE conditional statement on your html and or php page

 

<link rel="stylesheet" media="screen" href="css/firefox.css" type="text/css" />
<!--[if gte IE 5]><link rel="stylesheet" media="screen" href="css/IE5GTE.css" type="text/css" /><![endif]-->

 

 

what this does is reads the firefox.css (or whatever u called it) style unless its IE 5 or greater, then it SHOULD read the IE5GTE.css (or whatever u called it)

Link to comment
Share on other sites

This is something everyone who creates websites should know and do. Putting "Hacks" in the main css to make IE behave is no longer recommended (due to IE7 and the pending IE8 ignoring the old hacks).

 

Now using "IEOnly".css files is easy and clean thanks to the "Conditional Comment" zang8027 showed:

 

<!--[if gte IE 5]><link rel="stylesheet" media="screen" href="css/IE5GTE.css" type="text/css" /><![endif]-->

 

You will want to change this to exclude IE8 - which should be css2 spec standards compliant, I recommend changing gte to lt (less than) IE7:

 

<!--[if lt IE 7]><link rel="stylesheet" media="screen" href="css/IE5GTE.css" type="text/css" /><![endif]-->

 

They key to using the IEOnly.css file via the "conditional comment", is that the ONLY thing in the IEonly .css file you have to change are the bits of elements that need to be different in IE.

 

In other words, you don't need to copy the whole element from the main css file. Usually it is only margins/paddings or widths/heights that need tweaking in IE.

 

Examples:

 

Main css file would have:

#wrapper 
{
width: 800px;
margin: 0 auto;
margin-top:5px;
background: #ffffff url(images/wrapper_bg.png) top left repeat-y;
}

 

IE only css file fixes the margin problem for IE:

#wrapper {margin: -17px auto}

 

IE still uses the main css element's width, background and margin-top, but only changes the margin from  "0 auto" to "-17px auto".

 

Link to comment
Share on other sites

Wow you guys realy helpfull i tryed it and it worked .. but i stumbled to another problem complitly diffrance from last 1.

though related to div's as well.

ok so its like that i have my site pic . i am placeing divs on it and inside them things i like for E.G the pic contian a place for text field so i make a div make its position absolute place it on the right spot then go on firefox check to see . most of times its a bit off so i fix it .. then when i finaly have it on right place .. and actualy the text field looks as if its part of the pic and all . when i change resolotion the whole thing screws up the div with the text field inside it change its position complilty . now i have no idea how to fix this .

 

i use same code as i showed you before though with the fix that the 2 nice mates/womates:zang8027 ,dbrimlow mationed.

but this resulotion change just kill my site i dont know how to fix it would realy realy appriacate any help . thanks in advanced

Link to comment
Share on other sites

  • 5 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.