Toon posts:

Ruimte tussen drop down menu en header.

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik ben bezig met een website en gebruik daarbij een dropdown menu'tje, het enige probleem is dat er nu ruimte zit tussen de buttons en het logo.

Afbeeldingslocatie: http://img109.imageshack.us/img109/7231/tvm2.png

De code waar dit volgens mij in fout zit:

code:
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* 0 padding voor alle elements */
#dropDownMenu,
#dropDownMenu * {margin:0;padding:0;}
/* "Master" UL (the whole Menu) */
#dropDownMenu {
    position:relative;
    background:# no-repeat 100% 50%;
    width:850px; /* mj dit was 50em, misschien beter om em unit te houden.. */
    max-width:100%;
    float:none;
    margin-bottom:2px;
    border-bottom:2px;
    
    
    /*  custom style */
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    
}
/* sub-menu ULs */
#dropDownMenu li ul {
    width:11em !important;/* ruimte voor padding */
    cursor:default;
    position:absolute;
    height:auto;
    display:none;
    left:-10px;
    padding:0px 10px 10px 10px;
    /* Link dit in naar een lege image */
    /*background:url(images/spacer.gif);*//* trick to keep'em open */
}
/* All LIs */
#dropDownMenu li {
    position:relative;
    /*width:8.30em;
    max-width:16.5%;*/
    cursor:pointer;
    float:left;
    list-style-type:none;
    font-weight:bold;
    
    
}
/* sub-menu LIs */
#dropDownMenu li ul li {
    width:10em/*FF*/;
    padding:0;
    border:none;
    max-width:120%;
    border:0px solid #333;
    border-top:none;
}
/* All anchors */
#dropDownMenu li a {
    cursor:default;
    color:#666;
    border-left:0ngpx solid #333;
    text-decoration:none;
    display:block;
    float:left;
    padding:0 0em;
/*  uncomment the declaration below if you want to go "full width" */
/*  width:7.47em; */
    height:2em;
    line-height:em;
}
/* sub-menu Anchors */
#dropDownMenu li ul li a {
    width:9em/*FF*/;
    position:relative !important; /* ie Mac */
    cursor:pointer !important;
    white-space:nowrap;
    line-height:1.7em;
    height:1.4em;
    font-weight:normal;
    border:0px solid #fff;
    color:#666;
    background-position:0 50% !important;
}
/* :hover and stuff */
#dropDownMenu li a:hover,
#dropDownMenu li a:focus,
#dropDownMenu li a:active {color:#000}
/* move the declarations from the rule below the one above if you want a background swap on *all* anchors, including the top level ones */
#dropDownMenu ul a:hover,
#dropDownMenu ul a:focus,
#dropDownMenu ul a:active {color: !important;background:}
/* display and z-index for the sub-menus */
#dropDownMenu li:hover ul,
#dropDownMenu li.msieFix ul {display:block;z-index:10;top:2em !important;}
/* safari: users can keep sub-menus up by from sub-menus to next top level  */
/* didn't find a solution for users going back from the last one. I prefer  */
/* to leave it like that vs. taking the last sub-menu *out of* the wrapper  */
#dropDownMenu li#Home {z-index:6;}
#dropDownMenu li#Omgeving {z-index:5;}
#dropDownMenu li#Woningen {z-index:4;}
#dropDownMenu li#KR {z-index:3;}
#dropDownMenu li#ST {z-index:2;}
#dropDownMenu li#UZ {z-index:1;}

/* Current location - class on Body must match LI's id */
.Home #dropDownMenu li#menuHome a,
.Omgeving #dropDownMenu li#menuOmgeving a,
.Woningen #dropDownMenu li#menuWoningen a,
.KR #dropDownMenu li#KR a,
.ST #dropDownMenu li#ST a,
.UZ #dropDownMenu li#UZ a {color:#000;}
/* Keeping current menu accessible to JAWS */
.Home #dropDownMenu li#menuHome ul,
.Omgeving #dropDownMenu li#menuOmgeving ul,
.Woningen #dropDownMenu li#menuWoningen ul,
.KR #dropDownMenu li#KR ul,
.ST #dropDownMenu li#ST ul,
.UZ #dropDownMenu li#UZ ul {display:block;top:-1000px}

/* background colors */
#menuHome,#menuHome li a {background-color:#FF8A00;}
#menuOmgeving,#menuOmgeving li a {background-color:;}
#GJ,#GJ li a {background-color:#ffffff;}
#KR,#KR li a {background-color:#ffffff;}
#ST,#ST li a {background-color:#ffffff;}
#UZ,#UZ li a {background-color:#ffffff;}
/* "trigger" and "msieFix" classes */
#dropDownMenu li.msieFix a {}
/* last nested UL. keeping it in */ /* Gabi: verander UZ hier in de id van de laatste menu item.. */
#dropDownMenu li#UZ ul {left:-2.3em !important;}

/* If JS is OFF we need to style the links in the sub-menu of the current page     */
/* so they are accessible to keyboard users. Using a class on each link would let  */
/* us stick each link in the same place, but we would have to plug a lot of        */
/* attributes in the markup and many rules here, so...                             */
.Home #dropDownMenu li#menuHome ul li a:focus,
.Home #dropDownMenu li#menuHome ul li a:active,
.CF #dropDownMenu li#CF ul li a:focus,
.CF #dropDownMenu li#CF ul li a:active,
.GJ #dropDownMenu li#GJ ul li a:focus,
.GJ #dropDownMenu li#GJ ul li a:active,
.KR #dropDownMenu li#KR ul li a:focus,
.KR #dropDownMenu li#KR ul li a:active,
.ST #dropDownMenu li#ST ul li a:focus,
.ST #dropDownMenu li#ST ul li a:active,
.UZ #dropDownMenu li#UZ ul li a:focus,
.UZ #dropDownMenu li#UZ ul li a:active {position:absolute !important;top:1028px !important;}



Heeft iemand een idee hoe ik dit kan fixen :)?

  • André
  • Registratie: Maart 2002
  • Laatst online: 14:48

André

Analytics dude

Zet eens een display:block op dat logo.

Verwijderd

Topicstarter
Bedankt maar er veranderd dan niks :)

  • André
  • Registratie: Maart 2002
  • Laatst online: 14:48

André

Analytics dude

Heb je hem wel op het img element gezet? Het probleem is namelijk white-space die zorgt voor die ruimte. Heb je misschien een voorbeeld online staan?

  • Alex)
  • Registratie: Juni 2003
  • Laatst online: 18-11 20:57
Je zou eventueel iets kunnen proberen met overflow: hidden; op dat blok, maar je kunt beter de whitespace in je code weghalen....

We are shaping the future


Verwijderd

Topicstarter
http://wii60.eu/voorbeeld/index3

Daar staat een simpel voorbeeldje, het menu werkt maar je moet wel even de Warnings negeren :)

  • Alex)
  • Registratie: Juni 2003
  • Laatst online: 18-11 20:57
En nu graag eentje zodat we ook de CSS erbij hebben en het dus zien zoals jij het ook wil zien :)

We are shaping the future


Verwijderd

Topicstarter
Ik heb het verbeterd :) Je kunt de CSS nu ook zien als het goed is.

[ Voor 48% gewijzigd door Verwijderd op 11-01-2007 17:21 ]


  • moozzuzz
  • Registratie: Januari 2005
  • Niet online
In IE 6.x XP staat het menu zelfs niet horizontaal? (in je online voorbeeld). Let overigens op met suckerfish-menu's, dat ze onder je content komen te staan in de code. Een laatste keer ben ik wat eeuwen bezig geweest omdat de achtergrond van de <h1> uit m'n content door m'n menu piepte...

Heb je de padding/margin van je logo op 0 gezet?

  • Alex)
  • Registratie: Juni 2003
  • Laatst online: 18-11 20:57
@import 'http://computer-van-gabrian-van-houdt.local/~gabrianvanhoudt/kijkuit_final/css/keyBoardDropDown.css';

Daar kan ik jammergenoeg niet bij, dus ik zie ook geen CSS :(

We are shaping the future


Verwijderd

Topicstarter
In IE klopt er nog helemaal niks van, maar ik probeer het eerst te fixen in Safari en Fire Fox. Margin/padding op 0 maakt geen verschil.

  • Alex)
  • Registratie: Juni 2003
  • Laatst online: 18-11 20:57
Eh... er klopt niets van doordat zijn stylesheet niet beschikbaar is buiten zijn eigen computer :+

We are shaping the future


Verwijderd

Topicstarter
Kom je er nu wel in?

/het zit nog niet helemaal goed, even de links aanpassen.

[ Voor 60% gewijzigd door Verwijderd op 11-01-2007 18:33 ]


  • Alex)
  • Registratie: Juni 2003
  • Laatst online: 18-11 20:57
Je hebt niet het hele pad op je filesystem nodig, gewoon relatieve paden is genoeg :)

We are shaping the future


Verwijderd

Topicstarter
Ok:) Nu zou je het als het goed is moeten zien.

  • Alex)
  • Registratie: Juni 2003
  • Laatst online: 18-11 20:57
Er zit ruimte tussen je plaatjes, probeer de whitespaces eens weg te halen? Kijk ook eens naar deze pagina

We are shaping the future


Verwijderd

Topicstarter
Als ik 'normale' buttons gebruik, dus zonder dat drop down circus eromheen, dan heb ik geen last van die whitespace. Nu zitten die buttons voor ongeveer de helft over de achtergrond (van de tekst etc.) heen, ipv precies tussen het logo en het tekstvak.

Verwijderd

Topicstarter
Dubbelpost maar ik geloof dat ik het aardig opgelost heb met een simpeler dropdown menu met hetzelfde effect :) Toch bedankt voor alle help!

  • Alex)
  • Registratie: Juni 2003
  • Laatst online: 18-11 20:57
Afbeeldingslocatie: http://img9.imagepile.net/img9/1669kijkuit.jpg

Zo ziet die pagina die je eerder gaf eruit in IE7, niet helemaal goed dus...

We are shaping the future


Verwijderd

Topicstarter
Hm, ja misschien iets te vroeg gejuicht. De nieuwe versie ziet er wel beter uit dan op dat plaatje geloof ik, alleen werkt het dropdown menu in IE nog niet en zit er nog een whitespace tussen de buttons en het tekstvak, in Safari klopt echter wel alles.

http://wii60.eu/voorbeeld/index3.php

  • Alex)
  • Registratie: Juni 2003
  • Laatst online: 18-11 20:57
Ga eens op zoek naar 'suckerfish' en volg die stappen goed, dan werkt het wel :Y)

We are shaping the future


Verwijderd

Begin eerst eens met je site valid te maken:
ai caramba
Pagina: 1