XHTMLforum

XHTMLforum (http://xhtmlforum.de/index.php)
-   CSS (http://xhtmlforum.de/forumdisplay.php?f=73)
-   -   Tab Menü Problem (http://xhtmlforum.de/showthread.php?t=55043)

BloodHunger 21.12.2008 11:44

Tab Menü Problem
 
Hei Leute,

arbeite gerade an meiner Abiarbeit und bin auf n kleines Problem gestoßen das ich irgendwie nicht schaffe zu lösen. Hab mir n Tab Menü zusammengebastelt, das auch wunderbar funktioniert, das Problem ist, dass wenn niemand eingeloggt ist das Menü ganz normal linksbündig und alle Tabs hintereinander angeordnet werden sollen, das funktioniert auch, wenn ein User jedoch eingeloggt ist wird ein zusätzlicher Tab "MyAccount" angezeigt der als einziger rechtsbündig sein soll.

Hier mal der Code:

Templade Menü normal:
HTML-Code:

                <div id="menu_container" class="basictab">
                        <ul>
                                <li><a href="index.php?nav=index" tabindex="8">Startseite</a></li>
                                <li><a href="index.php?nav=faq" tabindex="9">FAQ</a></li>
                                <li><a href="index.php?nav=registrieren" tabindex="10">Registrieren</a></li>
                                <li><a href="index.php?nav=support" tabindex="11">Support</a></li>
                            </ul>
                </div>

Template Menü logged:
HTML-Code:

                <div id="menu_container" class="basictab">
                    <ul>
                                <li><a href="index.php?nav=index" tabindex="8">Startseite</a></li>
                                <li><a href="index.php?nav=faq" tabindex="9">FAQ</a></li>
                                <!--<li><a href="index.php?nav=registrieren" tabindex="10">Registrieren</a></li>-->
                                <li><a href="index.php?nav=support" tabindex="11">Support</a></li>
                                        <li><a href="index.php?nav=myaccount" class="myacc">My Account</a></li>
                            </ul>
           
                </div>

Die dazugehörige CSS:
Code:

.basictab {
        width: 795px;
        float: left;
}

.basictab ul {


        margin-right: 0px;
        padding: 3px 0;
        margin-left: 0;
        font: 0.75em Verdana;
        border-bottom: 0px solid gray;
        list-style-type: none;
        text-align: right;


}

.basictab li {

        display: inline;
        margin: 0;

}


.basictab li a {

        text-decoration: none;
        padding: 3px 7px;
        margin-right: 6px;
        border-bottom: none;
        color: #2d2b2b;
        background: url(images/menue_button.gif);
        background-repeat: no-repeat;
        float: left;
        width: 90px;
        text-align: center;

}

.basictab li a.myacc {

        text-decoration: none;
        padding: 3px 7px;
        margin-right: 6px;
        border-bottom: none;
        color: #2d2b2b;
        background: url(images/menue_button_myacc.gif);
        background-repeat: no-repeat;
        float: left;
        width: 90px;
        text-align: center;
       
}


.basictab li a:visited {

        color: #2d2b2b;

}

.basictab li a:hover, .basictab li a.current, .basictab li a:active {

        background-image:url(images/menue_button_hover.gif);
        color: black;

}

Und hier noch 2 Screenshots zum Verständnis:

Menü normal:
http://bildupload.sro.at/a/images/menue_normal.jpg

Menü logged:
http://bildupload.sro.at/a/images/menue_logged.jpg

Thx für die Hilfe

domsson 21.12.2008 14:41

Ich habe mal eine aehnliche Navigation gemacht, sogar ziemlich aehnlich (auch links die normalen und rechts die Tabs zur Accountverwaltung). Dabei hatte ich auch einige Probleme, bis ich dann die zweite Navigation als separate Liste realisiert habe, die ich somit problemlos rechts floaten lassen konnte. Vielleicht ist das ja in deinem Fall auch eine moegliche Loesung. :)

fricca 21.12.2008 14:55

Zitat:

Zitat von BloodHunger (Beitrag 415029)
wenn ein User jedoch eingeloggt ist wird ein zusätzlicher Tab "MyAccount" angezeigt der als einziger rechtsbündig sein soll.

Zitat:

.basictab li a.myacc {

text-decoration: none;
padding: 3px 7px;
margin-right: 6px;
border-bottom: none;
color: #2d2b2b;
background: url(images/menue_button_myacc.gif);
background-repeat: no-repeat;
float: left;
width: 90px;
text-align: center;

}
Die Hervorhebungen sind von mir. Vielleicht fällt dir selbst was ein dazu?

Bitte lies die Hinweise für Fragende. Immer vollständigen Code posten, keine Fragmente.

domsson 21.12.2008 14:59

Zitat:

Zitat von fricca (Beitrag 415065)
Die Hervorhebungen sind von mir. Vielleicht fällt dir selbst was ein dazu?

Bitte lies die Hinweise für Fragende. Immer vollständigen Code posten, keine Fragmente.

Haha, Gruess dich fricca. Vermutlich wird sich meine Helfermentalitaet mit der Zeit wohl auch noch etwas wandeln, was? :)

jw-lighting 21.12.2008 15:40

ähmm. ich gehe mal davon aus, das der code für eine Abiarbeit valide sein sollte. Ist "tabindex" als Attribut valide?

EDIT: Anscheinden ja. Welche Funktion hat dieses Attribut? werden die Links dadurch austomatisch horizontal angezeigt?

fricca 21.12.2008 15:48

SELFHTML: HTML/XHTML / Verweise (Links) / Tabulator-Reihenfolge und Tastaturkürzel für Verweise

jw-lighting 22.12.2008 16:04

Vielen Dank, das wusste ich noch nicht
:thumbsup:


Alle Zeitangaben in WEZ +2. Es ist jetzt 04:38 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

© Dirk H. 2003 - 2023