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

Add media query #7

Open
wants to merge 2 commits into
base: main
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
9 changes: 9 additions & 0 deletions intro-to-media-queries/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
p {
font-size: 14px;
}

@media all and (min-width: 800px) {
p {
font-size: 24px;
}
}
16 changes: 15 additions & 1 deletion mobile-first-development/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ h3 {

.group {
display: flex;
flex-direction: row;
flex-direction: column;
margin-bottom: 100px;
}

Expand All @@ -36,3 +36,17 @@ h3 {
.item-double {
flex: 2;
}


/* Groups and items (Desktop) */

@media all and (min-width: 800px) {
section,
h1 {
padding: 0 10%;
}

.group {
flex-direction: row;
}
}
14 changes: 10 additions & 4 deletions navigation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@
<h1>Your Name</h1>
<nav>
<ul id="menu">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#portfolio">Portfolio</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section id="home"></section>
<section id="about"></section>
<section id="portfolio"></section>
<section id="contact"></section>
</main>
</body>
</html>
62 changes: 62 additions & 0 deletions navigation/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
* {
border: 1px solid red;
}

body {
margin: 0;
}

header {
background-color: black;
/* space under the header so main content is not so close to the navigation */
margin-bottom: 40px;
}

header h1 {
color: white;
text-align: center;
margin: 0;
padding-top: 20px;
}

header nav {
display: flex;
/* center nav element */
justify-content: center;
}

header nav ul {
display: flex;
padding-left: 0;
/* remove bullet ponits */
list-style: none;
}

header nav ul li a {
color: white;
text-decoration: none;
margin: 0 20px 0 0;
}

header nav ul li:last-child a {
margin-right: 0;
}

/* When a web browser is larger then 600 pix, apply this rules */
@media all and (min-width: 600px) {
header {
display: flex;
justify-content: space-around;
padding: 0 30px;
}

header h1 {
margin: 14px 0;
padding-top: 0;
}

header nav {
margin-top: 8px
}

header nav ul li a:hover {
color: #bdbdbd;
}
}
6 changes: 5 additions & 1 deletion responsive-images/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ h3 {
}

.item {
flex: 1;
flex: 2;
margin: 10px;
}

Expand All @@ -49,3 +49,7 @@ h3 {
flex-direction: row;
}
}

main img {
width: 100%;
}