Bonjour à tous.
Y-a-t-il un moyen d'avoir des éléments fixed avec des flexbox.

Par exemple avoir le bandeau et la nav fixed et le reste en flexbox?


https://codepen.io/JefReb/pen/RxRwxx


Code css : 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
76
77
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
html, body {
	height: 100%;
	font-size: 100%;
}
body {
	font-family: "Times New Roman", Times, serif;
	font-size: 100%;
	width: 100%;
}
header, nav, section, article, aside, footer {
	border: 1px solid black;
}
#page {
	position: relative;
	width: 100%;
	height: auto;
	margin: 0 auto;
}
#page, main {
	display: -webkit-flex;
	display: flex;
	-webkit-flex-direction: column;
	flex-direction: column;
	justify-content: center;
}
header, nav, article, aside, footer {
	padding: 1em;
}
header {
	height: 140px;
}
article {
	height:2000px;  /* pour faire défiler la page sans texte */
}
@media screen and (max-width: 959px) {
article, aside {
	width: 100%;
}
nav, footer {
	order: 2;
}
}
@media screen and (min-width: 960px) {
#page {
	width: 960px;
}
header, nav, main, section, article, aside, footer {
	text-align: center;
}
nav {
	padding: 3px;
	height: auto;
}
section {
	display: -webkit-flex;
	display: flex; 					
	-webkit-flex-direction: row;
	flex-direction: row;
}
aside, article {
	margin: 1em;
}
article {
	min-height:900px;
	flex: 1 1 auto; 				
}
aside {
	width: 25%;
	height:auto;
	max-height:300px;
}
}
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
<div id="page">
  <header>Bandeau</header>
  <nav>Navigation</nav>
  <main>
    <section>
      <article>Article</article>
      <aside>aside </aside> 
    </section>
  </main>
  <footer>Pied de page</footer>
</div>