Bonjour à tous,

après avoir testé l'ouverture/fermeture d'une via javascript (trop compliqué au final) je teste cela avec CSS ... voici mon code de test :
Code html : 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
 
#voir {
        margin-top: 5px;
        padding: 10px;
        max-height : 0em;
        
        border: 0px solid;
        overflow: hidden;
        transition: all 5s;
}
 
#voir:target {
        max-height: 400 px;
        border: 1px solid;      
}
</style>
</head>
 
<body>
<br>
<h2>Page de test</h2>
<div><a id="open" href="#voir">Ouvrir...</a></div>
<div id="voir">
  <h1>contenu #3</h1> <p>Lorem Ipsum is simply dummy text of the printing and
    typesetting industry. Lorem Ipsum has been the
    industry s standard dummy text ever since the 1500s,
    when an
    unknown printer took a galley of type and
    scrambled it to make a type specimen book. It has
    survived
    not only five centuries, but also the leap
    into electronic typesetting, remaining essentially
    unchanged. It was popularised in the 1960s with the
    release of Letraset sheets containing Lorem Ipsum
    passages,
    and more recently with desktop publishing
    software like Aldus PageMaker including versions of
    Lorem
    Ipsum</p>
  <p>Lorem Ipsum is simply dummy text of the printing and
    typesetting industry. Lorem Ipsum has been the
    industry s standard dummy text ever since the 1500s,
    when an
    unknown printer took a galley of type and
    scrambled it to make a type specimen book. It has
    survived
    not only five centuries, but also the leap
    into electronic typesetting, remaining essentially
    unchanged. It was popularised in the 1960s with the
    release of Letraset sheets containing Lorem Ipsum
    passages,
    and more recently with desktop publishing
    software like Aldus PageMaker including versions of
    Lorem
    Ipsum</p>
  <div><a id="close" href="#">Fermer...</a></div>
</div>
</body>


- L'ouverture fonctionne mais le problème est que si le contenu est plus important la cadre n'affichera pas tout car limité par la valeur max-height (notamment si la largeur de la fenêtre est réduite).
- La fermeture bizarrement fonctionne ... mais là je ne sais pas pourquoi (si quelqu'un a une explication)

Pour finir je souhaite, si possible, que pendant l'ouverture le lien 'Ouvrir...' disparaisse pour réapparaitre après la fermeture de la DIV.

Quelqu'un peut-il m'aider ?