Hackerboard Wiki HaboBlog
Hackerboard bei Facebook Hackerboard bei Google+ Hackerboard bei Twitter

[HaBo]

 
(Web-) Design und webbasierte Sprachen Tipps & Tricks, Designabgleich, HTML & Javascript, Flash, ASP, PHP, Perl/CGI...

Problem mit CSS-Menü im Internet Explorer

Diskussion: Problem mit CSS-Menü im Internet Explorer im Forum (Web-) Design und webbasierte Sprachen, in der Kategorie Web, Network & Multimedia Palace; Anzeige Hi, ich habe folgendes Menü: Code: <div id="menu"> <ul><li><img src="../img/space.gif" class="space_menu"/></li></ul> <ul><li><span class="top_link"><a href="../news/eng_news.html">news</a></span></li></ul> <ul><li><img src="../img/space.gif" class="space_menu"/></li></ul> <ul> <li><span ...

Antwort
Alt 25.03.09, 11:33   #1 (permalink)
 
Registriert seit: 20.03.09
BlackPanter Leistung: Facit NTK
BlackPanter eine Nachricht über ICQ schicken
Likes: 0
Standard Problem mit CSS-Menü im Internet Explorer

Anzeige

Hi,

ich habe folgendes Menü:


Code:
<div id="menu">
			<ul><li><img src="../img/space.gif" class="space_menu"/></li></ul>
			<ul><li><span class="top_link"><a href="../news/eng_news.html">news</a></span></li></ul>
			<ul><li><img src="../img/space.gif" class="space_menu"/></li></ul>
			<ul>
				<li><span class="top_link">camp</span class="top_link">
					<ul>
						<li><a href="../camp/eng_information.html">information</a></li>
						<li><span class="top_link2">facilities</span>
							<ul>
								<li><a href="../camp/eng_jap-house.html">jap. house</a></li>
								<li><a href="../camp/eng_log-cabins.html">log cabins</a></li>
								<li><a href="../camp/eng_chapel.html">chapel</a></li>
								<li><a href="../camp/eng_main-house.html">main house</a></li>
							</ul>
						</li>
						<li><a href="../camp/eng_price-list.html">price list</a></li>
						<li><a href="../camp/eng_application.html">application</a></li>
						<li><a href="../camp/eng_about-us.html">about us</a></li>
					</ul>
				</li>
			</ul>
			<ul><li><img src="../img/space.gif" class="space_menu"/></li></ul>
			<ul><li><span class="top_link"><a href="../links/eng_links.html">links</a></span class="top_link"></li></ul>
        	<ul><li><img src="../img/space.gif" class="space_menu"/></li></ul>		
			<ul><li><span class="top_link"><a href="../contact/eng_contact.html">contact</a></span class="top_link"></li></ul>
        	<ul><li><img src="../img/space.gif" class="space_menu"/></li></ul>
			<ul><li><span class="top_link"><a href="../karuizawa/eng_karuizawa.html">karuizawa</a></span class="top_link"></li></ul>
        	<ul><li><img src="../img/space.gif" class="space_menu"/><img src="../img/space.gif" class="space_menu2"/></li></ul>
			<ul>
            	<li>
                	<span class="top_link">
                    	<a href="jap_.html"><img src="../img/flag_jap.jpg" width="20" height="12" border="0" />&nbsp;日本語</a>
                    </span>
                </li>
            </ul>
		</div>
Der CSS-Code dazu sieht so aus:

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

/*Menü*/

#menu {
width: 100%;
height: 20px;
background: #D6D6D6;
float: left;
font-family: "Arial", "Helvetica";
font-size: 12px;
}

#menu ul {
list-style: none;
margin: 0;
padding: 0;
width: auto;
float: left;
}

#menu a {

display: block;
/*font: normal 11px/16px arial, helvetica, sans-serif;
border-width: thin;
border-style: solid;
border-color: #ccc #888 #555 #bbb;*/
margin: 0;
padding: 2px 3px;
}

#menu a {
color: #000;
/*background: #efefef;*/
text-decoration: none;
position: relative;
top: -2px;
}

#menu a:hover {
color: #40A348;
}

#menu li {position: relative;}

#menu ul ul {
position: absolute;
z-index: 500;
background-color: #D6D6D6;
border-style: solid;
border-width: thin;
border-color: #000;
}

#menu ul ul ul {
position: absolute;
top: 0;
left: 100%;
width: 75px;
}

.top_link, .top_link2 {
display: block;
/*font: normal 11px/16px arial, helvetica, sans-serif;
border-width: thin;
border-style: solid;
border-color: #ccc #888 #555 #bbb;
background: #efefef;*/
margin: 0;
padding: 2px 3px;
color: #000;
}

.top_link2 {position:relative;top:-1px;left:1px;}
.top_link:hover, .top_link2:hover {color: #40A348;}

div#menu ul ul,
div#menu ul li:hover ul ul,
div#menu ul ul li:hover ul ul
{display: none;}

div#menu ul li:hover ul,
div#menu ul ul li:hover ul,
div#menu ul ul ul li:hover ul
{display: block;}
Das Menü ist horizontal angeordnet.
Wenn ich auf den Menüpunkt "camp" gehe, klappt mir ein Menü vertikall aus. Geh ich jetzt auf den Punkt "facilities" klappt mir ein weiteres Menü horizontal links davon aus.
Will ich jedoch auf einen Link in diesem Menü klicken, verschiwindet das Menü, sobald ich mit dem Mauszeiger in die näche des Menüs komme.

Dieses Problem habe ich nur im Internet Explorer. Im Firefox, Opera und Safari funktioniert alles einwandfrei.

Internet Explorer benutze ich in der Version 7. Alle anderen Browser sind auf dem aktuellen Stand.
BlackPanter ist offline   Mit Zitat antworten
Alt 27.03.09, 22:47   #2 (permalink)
 
Registriert seit: 20.01.03
Zwirni Leistung: Z3
Likes: 0
Standard

Punkt 1: der IE bis einschließlich Version 7 unterstützt die Pseudoklasse hover einzig bei Links. Du wendest sie aber auf span-Tags an - somit geht das im IE7 nicht. Alternative: nutze JavaScript für die aufklappenden Menüs.

Punkt 2: Dein Menü ist kein richtiges. Du müsstest auch die obersten Menüpunkte einzig als li's definieren. Nicht für jedes ein ul verwenden. Dann wäre es semantisch korrekter.
Zwirni ist offline   Mit Zitat antworten
   
HaBOT
 
- Anzeige -

Werbung ist gerade online    
Alt 27.03.09, 23:02   #3 (permalink)
LX
Moderator
 
Registriert seit: 14.02.06
LX Leistung: Z3
LX eine Nachricht über ICQ schicken LX eine Nachricht über AIM schicken LX eine Nachricht über Yahoo! schicken
Likes: 21
Arrow

IE7 kann :hover auf allen Elementen (nicht nur <a>), wenn man ihm einen entsprechenden DOCTYPE (nämlich einen stricten) vorgibt.
__________________
"Ever tried. Ever failed. No matter.
Try again. Fail again. Fail better."
- Samuel Beckett

JS BB LX UP
LX ist offline   Mit Zitat antworten
Alt 28.03.09, 01:04   #4 (permalink)
Themenstarter
 
Registriert seit: 20.03.09
BlackPanter Leistung: Facit NTK
BlackPanter eine Nachricht über ICQ schicken
Likes: 0
Standard

@Zwirni: Ich hab das Menü aus dem inet übernommen. Und solange es das tut was es soll, werd ichs wohl auch nicht ändern.

@LX: Vielen vielen Dank! Jetzt läuft alles richtig Seit echt klasse.
BlackPanter ist offline   Mit Zitat antworten
Antwort
   
- Anzeige -

Werbung ist gerade online    

[HaBo] » Web, Network & Multimedia Palace » (Web-) Design und webbasierte Sprachen » Problem mit CSS-Menü im Internet Explorer
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind aus
Pingbacks sind aus
Refbacks sind aus


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Internet Explorer Problem Mr. PPV Internet Allgemein 7 17.04.06 12:19
Problem mit dem Internet Explorer und T-Online 5.0 Crus Die Problemzone 13 31.10.04 15:05
Problem mit Internet Explorer Dummbo Windows 2 09.01.04 10:15
Mysteriöses Problem mit Internet Explorer Franco Windows 2 14.12.03 11:48
internet explorer - problem mit jpg-format carm Windows 3 24.10.03 17:39


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61