-
Notifications
You must be signed in to change notification settings - Fork 0
/
layout.css
104 lines (92 loc) · 2.3 KB
/
layout.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
/* universal selector - zero out all default margin and padding of browser */
* {
margin:0;
padding:0;
/*The "box-sizing:border-box;" declaration allows us to include the padding and border in an element's total width and height.*/
box-sizing: border-box;
}
html {background-color: white;}
body {
text-align:center ;
width:100% ;
background-color:gray ;
font-family: Arial, sans-serif;
margin:auto ;}
/* Center all headings and paragraphs*/
h1, h2, h3, h4, h5, p {text-align:center;}
header {
width: 100%;
background-color:red;
padding: 5px;
border: black solid 1px;
/* positioned based on the user's scroll position */
position: -webkit-sticky; /* Safari */
position: sticky;
top: 0;
/* When elements are positioned, they can overlap other elements.
The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).
An element can have a positive or negative stack order */
z-index: 1;
}
/* Clearfix hack */
.clearfix {
overflow:auto;
}
nav {
background-color:blue;
float:left;
width: calc(20% - 10px);
min-width: 100px;
height:500px;
margin:5px;
padding: 5px;
border: black solid 1px;
/* positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled */
position: fixed;
}
section {
background-color:yellow ;
float:left ;
width:calc(60% - 10px);
min-width: 100px;
height: 500px ;
margin: 5px ;
padding: 5px;
border: black solid 1px;
/* positioned relative to its normal position */
position: relative;
left: 20%;
}
article {
background-color:green ;
width:90% ;
height:400px ;
margin:auto ;
/* OVERFLOW property controls what happens to content that is too big to fit into an area.
*/
overflow: auto;
padding: 5px;
border: black solid 1px;
/* positioned relative to the nearest positioned ancestor */
position: absolute;
right: 0px;
}
aside {
background-color:purple ;
float:right ;
width: calc(20% - 10px);
min-width: 100px;
height:500px ;
margin:5px ;
padding: 5px;
border: black solid 1px;
}
footer {
background-color:orange;
/* use clear to stop the flow of content around a floating element*/
clear:both ;
padding: 5px;
border: black solid 1px;
/* Static is the default position for HTML elements */
position: static;
}