Probleme mit IE 6/7

DrunkenKilla

Ensign
Registriert
Aug. 2006
Beiträge
210
Hi, ich arbeite gerade an einer Seite und nun muss ich die auch anpassen für IE6 und IE7. Das Problem ist, dass ich ein .textfeld{} habe mit einer absoluten positionsangabe. das teil ist in einem div. dies funktioniert mit dem safari, firefox und ie8 aber nicht mit ie6 und 7. dann hab ich einen css hack eingebaut [if lt ie 7] dann anderes css verwenden. soweit so gut, mit dem ie7 geht das. ich musste margin-top und margin-left negative zahlen übergeben aber es funktioniert mit dem ie7. wie löse ich dies mit dem ie6, der das nicht will. das prob ist, der text ist gar nicht sichtbar.
 
Dann musst du eben zwei extra-Stylesheets basteln, einmal für = IE7 und einmal für < IE7:
PHP:
    <!--[if IE 7]>
      <style type="text/css">@import url(/stylesheets/ie7.css);</style>
    <![endif]-->
     <!--[if lt IE 7]>
      <style type="text/css">@import url(/stylesheets/ie6.css);</style>
    <![endif]-->
 
hab ich, der ie7 hack geht jedoch der ie6 nicht.

header:
Code:
{* CSS Style file *}
   <link rel="stylesheet" type="text/css" href="{$smarty.const.DOC_ROOT}/layout.css" />
   
   {* IE css hack *}
   <!--[if IE 6]><link rel="stylesheet" type="text/css" href="{$smarty.const.DOC_ROOT}/csshack2.css" /><![endif]-->
   <!--[if IE 7]><link rel="stylesheet" type="text/css" href="{$smarty.const.DOC_ROOT}/csshack.css" /><![endif]-->

layout.css:
Code:
.textfeld{
		width:240px;
		font-size: 12px;
		position: absolute;
		font-family: Arial, Sans, sans-serif;
		margin-top: 180px;
		margin-left: 120px;	
}

csshack2.css (margin ist auf Null gestellt, da nix ging):
Code:
.textfeld{
		width:240px;
		font-size: 12px;
		font-family: Arial, Sans, sans-serif;
		margin:0px 0px 0px 0px;		
}

und csshack.css:
Code:
.textfeld{
		width:240px;
		font-size: 12px;
		font-family: Arial, Sans, sans-serif;
		margin:-73px 0px 0px -250px;		
}

der ie7 hack funktioniert.
 
Zurück
Oben