-
Notifications
You must be signed in to change notification settings - Fork 3.6k
User interface flex #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User interface flex #238
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,10 @@ | |
| License: none (public domain) | ||
| */ | ||
|
|
||
| * { | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| html, body, div, span, applet, object, iframe, | ||
| h1, h2, h3, h4, h5, h6, p, blockquote, pre, | ||
| a, abbr, acronym, address, big, cite, code, | ||
|
|
@@ -16,13 +20,16 @@ article, aside, canvas, details, embed, | |
| figure, figcaption, footer, header, hgroup, | ||
| menu, nav, output, ruby, section, summary, | ||
| time, mark, audio, video { | ||
| margin: 0; | ||
| padding: 0; | ||
| margin: 20; | ||
| padding: 20; | ||
| border: 0; | ||
| font-size: 100%; | ||
| font: inherit; | ||
| vertical-align: baseline; | ||
|
|
||
|
|
||
| } | ||
|
|
||
|
|
||
| /* HTML5 display-role reset for older browsers */ | ||
| article, aside, details, figcaption, figure, | ||
| footer, header, hgroup, menu, nav, section { | ||
|
|
@@ -62,3 +69,77 @@ h1, h2, h3, h4, h5 { | |
| letter-spacing: 1px; | ||
| margin-bottom: 15px; | ||
| } | ||
|
|
||
| h1 { | ||
| font-size: 80px; | ||
| } | ||
|
|
||
| .container { | ||
| width: 880px; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a width to the container is a great way to make a predictable layout that will look the same every time. As we move into responsive layouts, I encourage you to think about the pros and cons of a fixed-width content container versus a responsive layout (or even just a different CSS property, like adding margins to the container). |
||
| margin: 0 auto; | ||
| } | ||
|
|
||
| header { | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: flex-start; | ||
| width: 100%; | ||
| } | ||
|
|
||
| header nav { | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: flex-start; | ||
| margin-top: 35px; | ||
| width: 75%; | ||
| } | ||
|
|
||
| header nav a { | ||
| margin-right: 65px; | ||
| font-size: 14px; | ||
| color: gray; | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| header nav a:hover { | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
|
|
||
| .cta { | ||
| margin-top: 100px; | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: flex-start; | ||
| justify-content: space-evenly; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like you're assigning the |
||
| text-align: center; | ||
| } | ||
|
|
||
| .cta img { | ||
| flex-direction: row; | ||
| justify-content: flex-start; | ||
| } | ||
|
|
||
| .main-content .top-content { | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: space-evenly; | ||
|
|
||
| } | ||
|
|
||
| .main-content .bottom-content { | ||
| display: flex; | ||
| flex-direction: row; | ||
| justify-content: space-around; | ||
| } | ||
|
|
||
| .bottom-content .text-content { | ||
| width: 280px; | ||
| } | ||
|
|
||
| footer { | ||
| margin: 32px 0; | ||
| text-align: center; | ||
| font-size: 14px; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding properties to a bunch of elements/classes at once is really efficient and it's a good coding practice when there's a use for it,, but I do want to caution you to think carefully about inheritance when you assign them like this. Many properties are inherited, but some are not -- and if the code you're writing applies to nearly every element on the page, it can be hard to predict and troubleshoot the changes you're making.