Skip to content
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

Devin Baldwin - Sprint-Challenge--UI-Responsive #348

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions ANSWERS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
<!-- Answers to the Self Study Questions go here -->
# Answers to the Self Study Questions

1. If you saw this HTML: `<div class="box box1 box2 box3"></div>` which class has the most specificity weight?
2. Describe the difference between `display: block;` and `display: inline;`.
3. While using flexbox, what axis are you using when you use the property: `align-items: center`?
4. What is the difference between fixed layout, adaptive layout, fluid layout, and responsive layout?
5. Why do we need to use the CSS property max-width on the outer most container in a responsive website?
### `1. If you saw this HTML: <div class="box box1 box2 box3"></div> which class has the most specificity weight?`

- box3 would carry the most weight outranking the class names behind it.

### `2. Describe the difference between display: block; and display: inline;.`

- `display: inline` Displays an element as an inline element (like <span>). Any height and width properties will have no effect. `display: block` Displays an element as a block element (like <p>). It starts on a new line, and takes up the whole width.

### `3. While using flexbox, what axis are you using when you use the property: align-items: center?`

- The alignment is set on the x axis.

### `4. What is the difference between fixed layout, adaptive layout, fluid layout, and responsive layout?`

- A fixed or static layout stays in its absolute position during resizing due to the use of px instead of more adaptive parameters.
- Adaptive layout means that there are several versions of the layout which are displayed based on the screen size of the viewer. Think of it as several fixed layout designs, layout A is displayed when the screen size is within size range N — NN.
- With fluid layout you specify sizes not in pixels, but in percentages. Meaning, if the screen size changes, the proportion of elements will stay the same.
- Responsive layouts will divide all possible screen sizes in ranges. The interface has slightly (or completely different) layout depending on the screen size it’s viewed on. Also, depending on the screen size, elements will stretch or shrink accordingly. Responsive layout provides a custom experience for whichever screen size it’s viewed on.

### `5. Why do we need to use the CSS property max-width on the outer most container in a responsive website?`

- Using max-width will adapt to any screen size and keep your page responsive.
130 changes: 115 additions & 15 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
v2.0 | 20110126
License: none (public domain)
*/
html {
font-size: 62.5%;
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
Expand Down Expand Up @@ -54,40 +57,62 @@ table {
html, body {
height: 100%;
font-family: 'Roboto', sans-serif;
margin-left: 9%;
margin-right: 9%;
}

h1, h2, h3, h4, h5 {
font-size: 18px;
margin-bottom: 15px;
font-size: 1.2rem;
margin-bottom: 1rem;
font-family: 'Rubik', sans-serif;
}

p {
line-height: 1.4;
}

.container {
width: 800px;
margin: 0 auto;
width: max-width;
}
.topnav {
margin-top:2%;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1%;
font-size: 1rem;
}
li a {
color: black;
text-decoration: none;
text-align: center;

}
header {
margin-top:5%;
margin-bottom:5%;
}
.header {
width: 100%;
}

.top-content {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
margin-bottom: 20px;
border-bottom: 1px dashed black;
margin-bottom: 2rem;
border-bottom: 0.1rem dashed black;
}

.top-content .text-container {
width: 48%;
padding: 0 1%;
padding-bottom: 20px;
padding-bottom: 2rem;
}

.middle-content {
margin-bottom: 20px;
border-bottom: 1px dashed black;
margin-bottom: 1rem;
border-bottom: 0.1rem dashed black;
}

.middle-content h2 {
Expand All @@ -103,9 +128,9 @@ p {

.middle-content .boxes .box {
width: 12.5%;
height: 100px;
height: 4.5rem;
background: black;
margin: 20px 2.5%;
margin: 1.4rem 2.5%;
color: white;
display: flex;
align-items: center;
Expand All @@ -114,7 +139,7 @@ p {

.bottom-content {
display: flex;
margin: 0 2% 20px;
margin: 0 2% 1rem;
justify-content: space-around;
}

Expand All @@ -136,11 +161,86 @@ footer nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 2%;
font-size: 14px;
padding: 1rem 2%;
font-size: 1rem;
}

footer nav a {
color: white;
text-decoration: none;
}
@media screen and (max-width: 1000px) {
#box2 {
background: forestgreen;
}
#box4 {
background: darkorchid;
}
#box6 {
background: hotpink;
}
#box8 {
background: indigo;
}
#box10 {
background: lawngreen;
}
}
@media screen and (max-width: 768px) {
.topnav {
flex-direction: column;
margin-bottom: 0;
}
li {
border: black 1px solid;
width: 100%;
text-align: center;
padding: 5%;
}
footer nav {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 2%;
font-size: 0.7rem;
}
#box1 {
background: teal;
}
#box3 {
background: gold;
}
#box5 {
background: cadetblue;
}
#box7 {
background: coral;
}
#box9 {
background: crimson;
}
}
@media screen and (max-width: 400px) {
.boxes {
flex-direction: row-reverse;
width: 100%;
flex-wrap: wrap;
}
.middle-content .boxes .box {
width:4.5rem;
}
#box10 {
display:none;
}
.top-content, .middle-content, .bottom-content {
flex-direction: column;
}
.top-content, .text-container {
padding: 0 1%;
padding-bottom: 2rem;
}
.top-content {
width:250%;
}
}
36 changes: 23 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

<html lang="en">
<head>
<meta charset="utf-8">

<meta name="viewport" charset="utf-8" content="width=device-width, intial-scale=1.0">
<title>Sprint Challenge - UI / RWD</title>

<link href="https://fonts.googleapis.com/css?family=Roboto|Rubik" rel="stylesheet">
Expand All @@ -12,7 +11,18 @@
</head>

<body>
<div class="container">
<ul class="topnav">
<li><a href="#"><img class="logo" src="/img/lambda-black.png"/></a></li>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>

<header><img class="header" src="/img/jumbo.jpg"/></header>

<div class="container container1 container2">
<section class="top-content">
<div class="text-container">
<h2>The Future</h2>
Expand All @@ -29,16 +39,16 @@ <h2>The Past</h2>
<h2>Why Did It Have To Be Boxes...</h2>

<div class="boxes">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
<div class="box">Box 4</div>
<div class="box">Box 5</div>
<div class="box">Box 6</div>
<div class="box">Box 7</div>
<div class="box">Box 8</div>
<div class="box">Box 9</div>
<div class="box">Box 10</div>
<div class="box" id="box1">Box 1</div>
<div class="box" id="box2">Box 2</div>
<div class="box" id="box3">Box 3</div>
<div class="box" id="box4">Box 4</div>
<div class="box" id="box5">Box 5</div>
<div class="box" id="box6">Box 6</div>
<div class="box" id="box7">Box 7</div>
<div class="box" id="box8">Box 8</div>
<div class="box" id="box9">Box 9</div>
<div class="box" id="box10">Box 10</div>
</div>

</section>
Expand Down