Bonjour,
La question a maintes fois été posée sur les forums, mais je n'y ai pas trouvé "ma" réponse
Mon html est d'un minimaliste extrême :
Les div sans texte se voient attribuer une image via les css, div dont je souhaiterais fixer la hauteur en % (les parents ont un height:100%).
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 <div id="test"> <div><div>jeny</div></div> <div><div></div></div> <div><div>arrive</div></div> <div><div></div></div> <div><div>pas</div></div> </div>
Voici une partie des CSS :
Si cela n'est pas possible, y-a t'il moyen de contourner le problème ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 body { min-height: 100%; margin: 0; padding: 0; } #test{ position: relative; width: 100%; margin: 0px auto; font-size: 0.9em; top: 0px; bottom: 0px; text-align: center; height: 100%; } #test div{ -webkit-perspective: 500px; -moz-perspective: 500px; -ms-perspective: 500px; -o-perspective: 500px; perspective: 500px; -webkit-perspective-origin: 50% 0; -moz-perspective-origin: 50% 0; -ms-perspective-origin: 50% 0; -o-perspective-origin: 50% 0; perspective-origin: 50% 0; width: 100%; margin: 0px auto; height: 100%; } #test div div{ -webkit-animation: rot 1s ease-in-out 1s backwards; -moz-animation: rot 1s ease-in-out 1s backwards; -ms-animation: rot 1s ease-in-out 1s backwards; -o-animation: rot 1s ease-in-out 1s backwards; animation: rot 1s ease-in-out 1s backwards; -webkit-transform-origin: 50% 0; -moz-transform-origin: 50% 0; -ms-transform-origin: 50% 0; -o-transform-origin: 50% 0; transform-origin: 50% 0; font-weight: bold; width: 250px; background: #91eaF3; text-align: center; margin: 0px auto; height: 100%; } #test div:first-child div{ /*div avec texte*/ font-size: 50px; letter-spacing: -2px; -webkit-animation-delay: 1s; -moz-animation-delay: 1s; -ms-animation-delay: 1s; -o-animation-delay: 1s; animation-delay: 1s; } #test div:nth-child(2) div{ /*div avec image*/ -webkit-animation-delay: 2s; -moz-animation-delay: 2s; -ms-animation-delay: 2s; -o-animation-delay: 2s; animation-delay: 2s; background-image: url(kodachrome-40.jpg); background-position: center center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; width: auto; height: 20%; }
Merci pour votre aide et bon week-end,
dh
Partager