File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+
3
+ < html lang ="nl ">
4
+
5
+ < head >
6
+ < meta charset ="utf-8 ">
7
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge,chrome=1 ">
8
+
9
+ <!--
10
+ This website was carefully constructed by
11
+ Interactive Studios
12
+ http://www.interactivestudios.nl
13
+ -->
14
+
15
+ < title > FlexVerticalCenter test</ title >
16
+
17
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0, maximum-scale=1.0 ">
18
+
19
+ < style type ="text/css ">
20
+ /* make sure we have a very flexible container */
21
+ body {
22
+ margin : 0 ;
23
+ height : 100% ;
24
+ }
25
+ html {
26
+ height : 100% ;
27
+ }
28
+
29
+ .the-item {
30
+ width : 20% ;
31
+ background : # eee ;
32
+ margin : 0 auto;
33
+ }
34
+ img {
35
+ max-width : 100% ;
36
+ }
37
+ </ style >
38
+
39
+ </ head >
40
+
41
+
42
+ < body >
43
+
44
+ < div class ="the-item ">
45
+ < p >
46
+ This box is 20% wide and is always vertically centered within it's parent, even if the view port changes (resize your window to see the result).
47
+ </ p >
48
+ </ div >
49
+
50
+
51
+ < script src ="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js "> </ script >
52
+ < script src ="jquery.flexverticalcenter.js "> </ script >
53
+
54
+ < script >
55
+ $ ( '.the-item' ) . flexVerticalCenter ( ) ;
56
+ </ script >
57
+
58
+
59
+ </ body >
60
+
61
+ </ html >
You can’t perform that action at this time.
0 commit comments