Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > CSS
CSS Forum d'entraide sur l'utilisation des feuilles de style CSS. Avant de poster : Cours CSS, FAQ CSS, Galerie CSS
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 02/12/2011, 11h36   #1
Invité de passage
 
Femme
Étudiant
Inscription : septembre 2010
Messages : 72
Détails du profil
Informations personnelles :
Sexe : Femme
Âge : 22
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : septembre 2010
Messages : 72
Points : 3
Points : 3
Par défaut Header position:fixed ne suit pas le scroll

Salutations à tous.

j'ai un soucis avec mon header, je n'arrive pas à lui faire suivre le scroll


J'ai ceci
Code css :
1
2
3
4
5
6
#topheader {
    width:100%;
    position:fixed;
    top: 5%;
    margin:-50px auto 0 auto;
}

Avec uniquement ce code, aucun soucis il suit bien.

J'utilise le projet open source - http://www.webkit.org/

J'ai donc voulu intégrer dans Webkit mon DIV et c'est la qu'est le soucis, mon header ne suit plus le scroll et après recherche, teste et j'en passe impossible de le faire suivre le scroll ...peut être cela va il vous sauter aux yeux sur ce qui pose problème ?

Code css :
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
body{
    position:relative;margin:0;
    -webkit-text-size-adjust:none;
    min-height:416px;
    font-family:helvetica,sans-serif;
/*    background:url(images/body-bg.jpg);*/
    -webkit-touch-callout:none;
    margin-top:70px;
    padding: 0;
}
 
.center{
    margin:auto;
    display:block
}
img{
    border:0
}
a:hover span.arrow{
    background-image:url(images/whitearrow.png)!important
}
#topbar{
    background:url(nimages/header.png);
    border-top: 1px solid #6b6960;
    width:100%; /* Taille : ici à 100% de la largeur de la fenêtre navigateur (à modifier selon le cas) */
 
}
.centrertexte{
    color:#FFFFFF;
    font-size:12px;
    white-space:nowrap;
    padding-left:5px;
}
#content {
    width:100%;
    position:relative;
    min-height:250px;
    height:auto;
    font-size:8pt;
    -webkit-transition-property:-webkit-transform;
    -webkit-transform-style:preserve-3d;
    z-index:0;overflow:hidden
 
}
#footer{text-align:center;
        position:relative;
        margin:20px 10px 0;
        height:auto;
        width:auto;
        bottom:10px
}
#footer a{
    text-decoration:none;
    font-size:9pt;
    color:#4C4C4C;
    text-shadow:#FFF 0 1px 0
}
.pageitem,
.form{
      background-color:#fff;
      border:#878787 solid 1px;
      font-size:8pt;
      overflow:hidden;
      padding:0;
      position:relative;
      display:block;
      height:auto;
      width:auto;
      margin:3px 9px 17px;
      list-style:none
}
.textbox{
    padding:5px 9px;
    overflow:hidden;
    border-top:1px solid #878787
}
.textbox p{
    margin-top:2px;
    color:#000;
    margin-bottom:2px;
    text-align:justify
}
.textbox img{
    max-width:100%
}
.textbox ul{
    margin:3px 0 3px 0;
    list-style:circle!important
}
.textbox li{
    margin:0!important
}
.pageitem li:first-child{
    border-top:0
}
li.menu:hover{
    background:url(images/menutouched.png) repeat-x #369
}
li.menu a:hover span.name,li.menu a:hover span.comment,li.store:hover .starcomment,li.store:hover .name,li.store:hover .comment,body.list li.withimage a:hover .comment{
    color:#fff;
    font-size:8pt;
}
li.menu a:hover span.comment{
    color:#CCF
}
li.menu a{
    display:block;
    height:43px;
    width:auto;
    text-decoration:none
}
li.menu a img{
    width:auto;
    height:32px;
    margin:5px 0 0 5px;
    float:left
}li.menu span.name{
    margin:11px 0 0 7px;
    width:auto;
    color:#000;
    font-weight:bold;
    font-size:8pt;
    text-overflow:ellipsis;
    overflow:hidden;
    max-width:75%;
    white-space:nowrap;
    float:left
}li.menu span.comment{
    margin:11px 30px 0 0;
    width:auto;
    color:#000;
    font-size:17px;
    text-overflow:ellipsis;
    overflow:hidden;
    max-width:75%;
    white-space:nowrap;
    float:right;
    color:#324f85
}
li.menu span.arrow,li.store span.arrow,body.musiclist span.arrow,body.list span.arrow{
    position:absolute;
    width:8px!important;
    height:13px!important;
    right:10px;top:15px;
    margin:0!important;background:url(images/arrow.png) no-repeat
}
li.store{height:90px;
         border-top:#878787 solid 1px;
         overflow:hidden;
         position:relative
}
li.store a{
    width:100%;
    height:90px;
    display:block;
    background:url(images/storebg.png) left top no-repeat;
    text-decoration:none;
    position:absolute
}
li.store:hover{
    background:url(images/storetouched.png) repeat-x
}
li.store .image{
    position:absolute;
    left:0;
    top:0;
    height:90px;
    width:90px;
    display:block
}
li.store .name{font-size:8pt;
               white-space:nowrap;
               margin:5px 0 0 95px;
               display:block;
               overflow:hidden;
               color:#000;
               max-width:60%;
               text-overflow:ellipsis;
               font-weight:bold;
               white-space:nowrap;
               text-overflow:ellipsis
}
li.store .comment,body.list li.withimage .comment{
    font-size:12px;
    color:#7f7f7f;margin:16px 0 0 95px;
    display:block;
    width:60%;
    font-weight:bold;
    white-space:nowrap;
    text-overflow:ellipsis;
    overflow:hidden
}
li.store .arrow,body.list li.withimage .arrow{
    top:39px!important
}
li.store .stars{
    margin:6px 0 0 95px
}
li.store .starcomment{
    position:absolute;
    left:165px;
    top:56px;
    font-size:12px;
    color:#7f7f7f;
    font-weight:lighter
}
.graytitle{
    position:relative;
    font-weight:bold;font-size:17px;
    right:20px;left:9px;color:#4C4C4C;
    text-shadow:#FFF 0 1px 0;
    padding:1px 0 3px 8px}.header{
    display:block;
    font-weight:bold;
    color:rgb(73,102,145);
    font-size:12pt;
    margin-bottom:6px;
    line-height:14pt
}
p.titre{
    position:absolute;top:0;left:0;right:0;padding:0 10px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;height:44px;line-height:44px;font-weight:bold;color:#FFF;text-shadow:rgba(0,0,0,0.6) 0 -1px 0;font-size:16pt
}
#recherche{
    padding-top:40px;
    background-image:url(images/background_recherche.png);
    background-repeat:no-repeat;
    width:460px;
    padding-left:3px;
    color: #FFFFFF;
    font-size:8pt;
}
#recherche input[type=submit]{
    border:2px outset #A6BEDE;
    font-weight:bold;
    cursor:pointer;
    color: #FFFFFF;
    background-color: #2f0057;
}
label
{
    display: block;
    width: 150px;
    float: left;
}
#topheader {
    width:100%;
    position:fixed;
    top: 5%;
    margin:-50px auto 0 auto;
}
#topheader ul {
    margin-left: 0;
    padding-left: 0;
    display: inline;
}
#topheader ul li{
    margin-left: 0;
    list-style: none;
    display: inline;
    margin-right: -5px;
}



Je vous remercie par avance
Lekno est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/12/2011, 18h56   #2
Modérateur
 
Avatar de NoSmoking
 
Homme
Inscription : janvier 2011
Messages : 2 944
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Isère (Rhône Alpes)

Informations forums :
Inscription : janvier 2011
Messages : 2 944
Points : 4 776
Points : 4 776
Bonjour,
généralement lorsque l'on met un élément en position:fixed c'est justement pour qu'il ne suive pas le scroll de la page.

Aurais je mal compris ton soucis?
NoSmoking est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/12/2011, 13h40   #3
Invité de passage
 
Femme
Étudiant
Inscription : septembre 2010
Messages : 72
Détails du profil
Informations personnelles :
Sexe : Femme
Âge : 22
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : septembre 2010
Messages : 72
Points : 3
Points : 3
Je te remercie pour ta remarque, après réfléxion ça fonctionne parfaitement comme ceci.

Code css :
1
2
3
4
5
6
#topheader {
    background-color: #000000;
    position: fixed;
    width:100%;
    height:auto;
}
Lekno est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 15h08.


 
 
 
 
Partenaires

Hébergement Web