Firefox macht Probleme mit CSS

  • Hi,

    folgendes Problem. Ich bin gerade dabei eine neue Page zu erstellen. Den Body hab ich ´mit CSS formatiert.
    Die Hintergrundgrafik ist in drei Bereiche geteilt, Header, Center und Bottom! Im Header hab ich zusätzlich eine kleine Flash Animation.

    Wenn man das ganze mit dem IE ausführt, wird alles korrekt dargestellt. Im Firefox verschiebt sich jedoch die Grafik, die Animation bleibt! Ebenso kodiert der Firefox das Menü nicht richtig, siehe Menüpunkt Gaststätte. Die Dropdown Container verlieren ihre Border.

    Woran liegt das?

    Hier ist ein Link, um das Problem zu Veranschaulichen.

    http://www.ak-racing-shop.de/ak-racing/

    Hier der CSS Code:

    @charset "utf-8";
    /* CSS Document */

    #body
    { width:955px;
    height:auto;
    margin:auto;
    }

    #top
    { width:955px;
    height:140px;
    background-image:url(../images/backgrounds/top2.png);
    }

    #center
    { width:955px;
    min-height:438px;
    background-image:url(../images/backgrounds/center.gif);
    }

    #bottom
    { width:955px;
    height:32px;
    background-image:url(../images/backgrounds/bottom.gif);
    }

    #header
    { width:910px;
    height:120px;
    margin-left:23px;
    margin-top:20px;
    }

    #menu
    { width:910px;
    height:28px;
    margin-left:23px;
    }

    #container
    { width:910px;
    min-height:438px;
    margin-left:23px;
    }

    Hier der Quelltext der index.php:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>AK-Racing</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body id="body">
    <div id="top"><div id="header">
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/…','flash/banner' ); //end AC code
    </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/…ersion=9,0,28,0" width="910" height="120">
    <param name="movie" value="flash/banner.swf" />
    <param name="quality" value="high" /><param name="SCALE" value="exactfit" />
    <embed src="flash/banner.swf" width="910" height="120" quality="high" pluginspage="http://www.adobe.com/shockwave/down…=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
    </object>
    </noscript></div></div>
    <div id="center">
    <div id="menu">
    <ul id="MenuBar1" class="MenuBarHorizontal">
    [*]Home
    [*]Kartbahn 
    [*]Handel 
    <ul>
    [*]Neuigkeiten
    [*]Motore 
    <ul>
    [*]Iame 
    [*]TM 
    [*]Vortex 
    [/list]

    [*]Reifen 
    <ul>
    [*]Bridgestone 
    [*]Continental 
    [*]Dunlop 
    [/list]

    [*]Chassis 
    <ul>
    [*]Intrepid 
    [*]Tony Kart 
    [*]Kosmic 
    [/list]

    [*]Bekleidung 
    <ul>
    [*]Overalls 
    [*]Helme 
    [/list]

    [/list]

    [*]Racing Team 
    [*]Gaststätte 
    <ul>
    [*]Kontakt 
    [*]Speisen 
    [/list]

    [*]Forum 
    [*]Kontakt 
    [/list]
    </div>
    <div id="container">jkjkjk</div>
    </div>
    <div id="bottom"></div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>

    Hoffe dass das Problem bekannt ist.

    Gruß

    Alimaniac

  • mach doch mal bei #header ein padding-top: 30px; rein.
    Bei mir siehts damit schon besser aus.
    dem body muss du übrigens keine id geben, um ihn in css ansprechen zu können: einfach in der css body {} und es klappt schon :)


  • Hi,

    ja das klappt. Ist aber doch seltsam das margin nicht geht.

    Hast du vlt. auch noch nen Vorschlag wegen den Subemenus? Verstehe nicht wieso die Border da Probleme machen.

    Hier mal der CSS Code:

    /* The outermost container of the Menu Bar, an auto width box with no margin or padding */
    ul.MenuBarHorizontal
    {
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 11px;
    font-family:Arial, Helvetica, sans-serif;
    cursor: default;
    width: auto;
    }
    /* Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html */
    ul.MenuBarActive
    {
    z-index: 1000;
    }
    /* Menu item containers, position children relative to this container and are a fixed width */
    ul.MenuBarHorizontal li
    {
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 11px;
    font-weight:bold;
    position: relative;
    text-align: left;
    cursor: pointer;
    width: 130px;
    float: left;
    background-color: #FFF;
    }
    /* Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) */
    ul.MenuBarHorizontal ul
    {
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size: 100%;
    z-index: 1020;
    cursor: default;
    width: 130px;
    position: absolute;
    left: -1000em;
    }
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
    {
    left: auto;
    }
    /* Menu item containers are same fixed width as parent */
    ul.MenuBarHorizontal ul li
    {
    width: 130px;
    }
    /* Submenus should appear slightly overlapping to the right (95%) and up (-5%) */
    ul.MenuBarHorizontal ul ul
    {
    position: absolute;
    margin: -5% 0 0 95%;
    }
    /* Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */
    ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
    {
    left: auto;
    top: 0;
    }

    /*******************************************************************************

    DESIGN INFORMATION: describes color scheme, borders, fonts

    *******************************************************************************/

    /* Submenu containers have borders on all sides */
    ul.MenuBarHorizontal ul
    {
    border: 1px solid red;
    }
    /* Menu items are a light gray block with padding and no text decoration */
    ul.MenuBarHorizontal a
    {
    display: block;
    cursor: pointer;
    background-color: #fafafa;
    padding: 0.5em 0.75em;
    color: #333;
    text-decoration: none;
    }
    /* Menu items that have mouse over or focus have a blue background and white text */
    ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
    {
    background-color: #666666;
    color: #FFF;
    }
    /* Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */
    ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
    {
    background-color: #666666;
    color: #FFF;
    }

    /*******************************************************************************

    SUBMENU INDICATION: styles if there is a submenu under a given menu item

    *******************************************************************************/

    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenu
    {
    background-image: url(SpryMenuBarRight.gif);
    background-repeat: no-repeat;
    background-position: 95% 50%;
    }

    /* Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */
    ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover
    {
    background-image: url(SpryMenuBarRightHover.gif);
    background-repeat: no-repeat;
    background-position: 95% 50%;
    }

    /*******************************************************************************

    BROWSER HACKS: the hacks below should not be changed unless you are an expert

    *******************************************************************************/

    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe */
    ul.MenuBarHorizontal iframe
    {
    position: absolute;
    z-index: 1010;
    }
    /* HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */
    @media screen, projection
    {
    ul.MenuBarHorizontal li.MenuBarItemIE
    {
    display: inline;
    f\loat: left;
    background: #FFF;
    }
    }

  • Also, damit das Menü an der richtigen STelle erscheint, hab ich einfach einen kleinen Hack eingefügt. Jetzt ist es in IE und FF ok. Lediglich in FF stimmt der Code noch nicht, jemand einen Hinweis? Ich versteh nicht, warum die roten Border in den Subs verschwinden.

  • Bin jetzt ein wenig weiter und hab noch die Bereichhe für den Content eingefügt. Dieser wird übrigens mit PHP include eingebunden.

    Es gibt aber schon das nächste Problem. Geht mal unter http://www.ak-racing-shop.de/ak-racing/ und klickt im Menür Kartbahn den Unterpunkt Supermoto an. Im IE wird auch der Background richtig verlängert (nach unten scrollen). Im FF gleicht er sich nicht an den Content an.

    Zudem ignoriert der FF das Padding, d.h. der Content schießt einfach rechts neben dem div raus! Im IE bleibts drin, da muss ich nur noch die Pixel Angaben ändern. Damits bündig wird.

    Langsam nervts mich, weil ich persönlich nicht weiterkomme. Hab jetzt schon einiges versucht.

  • Wenn du ordentlich codest, sollten die Unterschiede zwischen IE und FF nicht mehr zu groß sein. Bringe dazu zunächst die Seite im FF auf Vordermann und sieh nach, ob im IE noch was zu korrigieren ist.
    Das

    HTML
    <html>
    
    
    <head>

    darf z.B. nur einmal vorkommen.

    Beseitige mal zunächst diese Fehler.
    Verwende dann eine einheitliche CSS-Datei.
    Entscheide dich für Tabellen oder Div's (besser div's) und verzichte auf diesen sonderbaren Mix aus beidem.

    Schreibe alle Style-Angaben in die CSS und nicht in den HTML-Quelltext.

    Solche Sachen

    Code
    <p align="center" class="Stil1"></p>

    sind unnötig.

    Beschäftige dich etwas mehr mit der Theorie von HTML und CSS, damit du einen sauberen Quelltext bekommst.

  • Ich hatte das problem zwar noch nicht aber so etwas ähnliches mit css!
    ich sage dir nur mach die seite nich mit Firefox sondern mit IE Explorer 7(neueste Version) und dann dürfte es klappen!

  • Wenn die Grundprinzipien des Code-Standards nicht eingehalten werden, hat jeder Browser Probleme. Manche sind in der Fehlertolereanz großzügiger, andere weniger.
    Da du jedoch nie weißt, wer mit welchem Browser deine Seite besucht, musst du dafür sorgen, dass sie in möglichst allen Browsern ordentlich aussieht.