yanivkalfa Posted April 2, 2008 Share Posted April 2, 2008 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 :-) Quote Link to comment Share on other sites More sharing options...
zang8027 Posted April 2, 2008 Share Posted April 2, 2008 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) Quote Link to comment Share on other sites More sharing options...
yanivkalfa Posted April 2, 2008 Author Share Posted April 2, 2008 this is realy nice idea actualy !!! i will try that Quote Link to comment Share on other sites More sharing options...
dbrimlow Posted April 2, 2008 Share Posted April 2, 2008 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". Quote Link to comment Share on other sites More sharing options...
yanivkalfa Posted April 2, 2008 Author Share Posted April 2, 2008 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 Quote Link to comment Share on other sites More sharing options...
yanivkalfa Posted September 15, 2008 Author Share Posted September 15, 2008 will this if works for opera / chrom /fireforx ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.