-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss-guide.txt
More file actions
191 lines (141 loc) · 3.25 KB
/
css-guide.txt
File metadata and controls
191 lines (141 loc) · 3.25 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
CSS Guide: Styling Your Webpage
Objective: Style the webpage created in the HTML guide using CSS. This guide covers basic styling, layout techniques, and a dark mode toggle.
Basic Body Styling
Set the font, margin, padding, background color, and text color.
body{
font-family: Georgia, 'Times New Roman', Times, serif;
margin: 0;
padding: 0;
background:linear-gradient(lime,white,salmon);
color: #333;
}
Header Styling
Style the header with a background color, text color, and padding.
header {
background-color: #333;
color: #fff;
padding: 1em 0;
text-align: center;
}
header h1 {
margin: 0;
}
nav ul {
list-style: none;
padding: 0;
}
nav ul li {
display: inline;
margin: 0 10px;
}
nav ul li a {
color: #fff;
text-decoration: none;
}
Main Content Styling
Add padding and margin to the main content and sections.
main {
padding: 20px;
max-width: 800px;
margin: auto;
}
section {
background-color: #fff;
margin: 20px 0;
padding: 20px;
border-radius: 9px;
box-shadow: 0 0 10px black;
}
h2 {
color: #333;
}
Color Example Styling
Style the color example box with a gradient background and text color.
.color-example {
background: linear-gradient(to left, blue, rgb(0, 255, 115));
color: #fff;
padding: 20px;
text-align: center;
border-radius: 10px;
margin: 10px 0;
}
Flexbox and Grid Layout Styling
Use flexbox for flexible layout and grid for a grid-based layout.
.flex-container {
display: flex;
gap: 10px;
margin: 20px 0;
}
.flex-item {
background-color: #2196F3;
color: #fff;
padding: 20px;
text-align: center;
border-radius: 10px;
flex: 1;
}
.grid-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
margin: 20px;
}
.grid-item {
background-color: orange;
color: #fff;
padding: 20px;
text-align: center;
border-radius: 10px;
}
Footer Styling
Style the footer with background color, text color, and padding.
footer {
text-align: center;
padding: 10px;
background-color: #333;
color: #fff;
}
Responsive Design
Adjust flexbox and grid layout for smaller screens.
@media (max-width: 600px) {
.flex-container {
flex-direction: column;
}
.grid-container {
grid-template-columns: 1fr;
}
}
Dark Mode Styling
Add styles for dark mode to change background and text colors.
/* Dark mode styles*/
body.dark-mode{
background:linear-gradient(#121212,grey,darkslategrey);
color: #e0e0e0;
}
header.dark-mode, footer.dark-mode {
background-color: #1e1e1e;
color: #e0e0e0;
}
section.dark-mode {
background-color: #797979;
color: #e0e0e0;
}
/*Back To Top Button*/
#bToTop{
position: fixed;
bottom: 0;
right: 0;
margin:0 30px 50px 0;
background-color: #121212;
height: 50px;
width: 50px;
display: grid;
border-radius: 180px;
align-items: center;
justify-content: center;
color: #fff;
text-decoration: none;
}
#bToTop:hover{
box-shadow: lime 0px 0px 10px;
}