Advertisement
Guest User

CodeWithJulio - Source Code (CSS) w /responsiveness

a guest
Jun 23rd, 2019
1,014
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.70 KB | None | 0 0
  1. * {
  2. margin: 0;
  3. padding: 0;
  4. box-sizing: inherit; /* Everything will inherit the border-box below */
  5. }
  6.  
  7. html {
  8. box-sizing: border-box;
  9. font-family: sans-serif;
  10. font-size: 10px;
  11. }
  12.  
  13. /* Reset of all the anchor tags */
  14. a {
  15. text-decoration: none;
  16. }
  17.  
  18. /* Grid Container */
  19. #wrapper {
  20. width: 100%;
  21. height: 100vh;
  22. display: grid;
  23. /* Added items below in classes, now setup grid template columns and rows */
  24. grid-template-columns: 15% auto;
  25. grid-template-rows: auto 80%; /* for the side bar */
  26. grid-template-areas:
  27. "sidebar main" /* we want sidebar along side main content */
  28. "sidebar main" /* replicating above */
  29. "sidebar footer"; /* Sidebar is along side footer */
  30. }
  31.  
  32. /* Sidebar Container */
  33. .sidebar {
  34. grid-area: sidebar; /* Give the area a name */
  35. background-color: #2c1b28;
  36. }
  37.  
  38. /* Centering Navigation Links */
  39. nav {
  40. text-align: center;
  41. }
  42.  
  43. /* Title */
  44. .brand {
  45. background-color: #fff;
  46. padding: 2.5rem 0;
  47. }
  48.  
  49. /* Selecting the link within brand class */
  50. .brand > .nav-link {
  51. font-size: 2rem;
  52. color: #2c1b28;
  53. }
  54.  
  55. /* Remove the bullet points from the list */
  56. .nav-list {
  57. list-style: none;
  58. }
  59.  
  60. /* Spacing between each nav item */
  61. .nav-item {
  62. margin: 5rem 0;
  63. }
  64.  
  65.  
  66. /* Navigation links */
  67. .nav-link {
  68. font-size: 1.6rem;
  69. color: #fff;
  70. text-transform: uppercase;
  71. padding: 1rem;
  72. }
  73. /* Hover Link Effect */
  74. .nav-link:hover {
  75. border-bottom: 2px solid #fff;
  76. }
  77.  
  78. /* Main Content Container w/ bg image */
  79. .main-content {
  80. grid-area: main;
  81. background: linear-gradient(326deg, #5f0a87 0%, rgba(164, 80, 139, 0.8) 74%),
  82. url("./images/grid-bg1.jpg") center no-repeat;
  83. background-size: cover;
  84. position: relative; /*Going to set something within the main-content to absolute*/
  85. }
  86.  
  87. /* Actual Content within the above container */
  88. .main-content-cta {
  89. position: absolute; /* Can manipulate the content inside the main-content container */
  90. top: 55%;
  91. right: 10%;
  92. transform: translateY(-55%);
  93. color:#fff;
  94. text-align: center;
  95. text-transform: uppercase;
  96. }
  97.  
  98. /* Content Style (heading) */
  99. .main-content-cta h1 {
  100. font-size: 5rem;
  101. }
  102.  
  103. /* Content Style (sub-heading) */
  104. .main-content-cta h6 {
  105. font-size: 2rem;
  106. margin-bottom: 2rem;
  107. }
  108.  
  109. /* Button Container */
  110. .btn-group {
  111. display: flex;
  112. justify-content: center;
  113. margin-bottom: 2rem;
  114. }
  115.  
  116. /* Button Style */
  117. .btn {
  118. color: #fff;
  119. padding: 1.5rem 5rem;
  120. border: 2px solid rgba(255,255,255,.6);
  121. }
  122. /* Hover Button Effect */
  123. .btn:hover{
  124. border: 2px solid #000;
  125. }
  126.  
  127. /* Give spacing between buttons using first button */
  128. .btn:first-child {
  129. margin-right: 1rem;
  130. }
  131.  
  132. /* Date under buttons */
  133. .main-content-cta .date {
  134. color: #facc6b;
  135. font-size: 2rem;
  136. }
  137.  
  138. /* Footer Container */
  139. .footer {
  140. grid-area: footer;
  141. background-image: linear-gradient(315deg, #fabc3c 0%, #facc6b 75%);
  142. height: 100%;
  143. display: flex;
  144. align-items: center;
  145. }
  146.  
  147. /* Creating container for heading */
  148. .panc-notice {
  149. height: inherit; /* Takes .footer height and inherits into this container */
  150. width: 100%;
  151. max-width: 40rem; /* Doesn't get bigger than 40rem*/
  152. background-color: #fff;
  153. display: flex;
  154. }
  155.  
  156. /* Heading */
  157. .panc-notice h1 {
  158. margin: auto; /* Centering */
  159. text-transform: uppercase;
  160. position: relative; /* Creating a sudo element underneath */
  161. }
  162.  
  163. /* Creating Line Underneath Heading */
  164. .panc-notice h1::before {
  165. content: "";
  166. position: absolute;
  167. left: 0;
  168. bottom: -1.5rem;
  169. width: 5.5rem;
  170. height: 3px;
  171. background-image: linear-gradient(315deg, #fabc3c 0%, #facc6b 75%);
  172. }
  173.  
  174. /* Stats Container */
  175. .statistics {
  176. width: 100%;
  177. display: flex;
  178. justify-content: space-between;
  179. padding: 0 5rem;
  180. }
  181.  
  182. /* items within Container */
  183. .statistics .item {
  184. width: 100%;
  185. display: flex;
  186. align-items: center;
  187. color: rgba(255,255,255,0.7);
  188. }
  189.  
  190. /* Sizing the Icons */
  191. .statistics .item i{
  192. font-size: 8rem;
  193. padding: 0 3rem;
  194. }
  195.  
  196. /* Item Description */
  197. .item-desc p{
  198. font-size: 1.4rem;
  199. }
  200.  
  201. /* When the browser window is 768px wide or less (ipad width)*/
  202. @media only screen and (max-width: 768px) {
  203. #wrapper {
  204. grid-template-columns: 20% auto;
  205. }
  206. .brand > .nav-link {
  207. font-size: 1.5rem;
  208. }
  209.  
  210. .nav-link {
  211. font-size: 1.2rem;
  212. }
  213.  
  214. .main-content-cta {
  215. top: 70%;
  216. right: 20%;
  217. }
  218. .panc-notice {
  219. width: 30%;
  220. }
  221. .panc-notice h1 {
  222. font-size: 1.5rem;
  223. margin-left: 20px;
  224. }
  225. .panc-notice h1::before {
  226. width: 5rem;
  227. }
  228. .statistics {
  229. padding: 0 1.2rem;
  230. justify-content: baseline;
  231. }
  232. .statistics .item i{
  233. font-size: 3rem;
  234. padding: 0 1.5rem;
  235. }
  236. .item-desc p {
  237. font-size: 1.2rem;
  238. }
  239. }
  240.  
  241. /* When the browser window is 600px wide or less */
  242. @media only screen and (max-width: 600px) {
  243. #wrapper {
  244. grid-template-columns: 20% auto; /* Increased Column Wide */
  245. }
  246. .brand > .nav-link {
  247. font-size: 1.2rem; /* Reduced Font-size */
  248. }
  249.  
  250. .nav-link {
  251. font-size: 1rem; /* Reduced Font-size */
  252. }
  253.  
  254. /* Positioning of the content inside main-content container */
  255. .main-content-cta {
  256. top: 70%;
  257. right: 10%;
  258. }
  259. .panc-notice h1 {
  260. font-size: 1rem;
  261. margin-left: 5px;
  262. }
  263. .panc-notice h1::before {
  264. width: 3rem;
  265. }
  266. .statistics {
  267. padding: 0 3rem;
  268. justify-content: baseline;
  269. }
  270. .statistics .item i{
  271. font-size: 2rem;
  272. padding: 0 1.5rem;
  273. }
  274. .item-desc p {
  275. font-size: .8rem;
  276. }
  277. }
  278.  
  279. /* When the browser window is 360px wide or less (S7 Edge) */
  280. @media only screen and (max-width: 360px) {
  281. #wrapper {
  282. grid-template-columns: 25% auto;
  283. }
  284. .brand > .nav-link {
  285. font-size: .8rem;
  286. padding: 1rem 0;
  287. }
  288. .nav-link {
  289. font-size: .6rem;
  290. }
  291. .main-content-cta {
  292. top: 70%;
  293. right: 10%;
  294. }
  295. .btn {
  296. padding: 1rem 2rem;
  297. }
  298. .panc-notice h1 {
  299. font-size: .7rem;
  300. margin: auto 5px;
  301. }
  302. .panc-notice h1::before {
  303. width: 1.5rem;
  304. }
  305. .statistics {
  306. padding: 0 1rem;
  307. justify-content: baseline;
  308. }
  309. .statistics .item i{
  310. font-size: 1rem;
  311. padding: 0 1.5rem;
  312. }
  313. .item-desc h1 {
  314. font-size: 1.3rem;
  315. }
  316. .item-desc p {
  317. font-size: .8rem;
  318. }
  319. }
  320.  
  321. /* Myles Luke - 23/06/2019 @ 11am */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement