Skip to content
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
Binary file added images/menu-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ironhack News</title>
<link rel="stylesheet" href="styles/style.css" />
<link rel="stylesheet" href="styles/responsive.css" />
</head>
<body>
<header>
Expand All @@ -16,6 +17,10 @@ <h1 class="newspaper-name">Ironhack News</h1>
<li><a href="#">Tech</a></li>
<li><a href="#">Sports</a></li>
</ul>

<nav class="mob-nav">
<img src="images/menu.png" alt="" />
</nav>
</nav>
</header>

Expand Down Expand Up @@ -71,7 +76,6 @@ <h2>Article 3</h2>
</section>
</main>


<!-- DO NOT REMOVE - viewport width label -->
<span class="viewport-dimensions"></span>
<!-- DO NOT REMOVE - A simple JS script used to display the viewport width label -->
Expand Down
147 changes: 147 additions & 0 deletions styles/responsive.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
@media screen and (max-width: 480px) {
.navbar {
display: none;
}
.newspaper-name {
border-bottom: none;
}

.mob-nav img {
display: block;
width: 32px;
margin: 0 auto;
}
}

@media screen and (min-width: 481px) and (max-width: 769px) {
.navbar {
display: flex;
flex-direction: column;
gap: 10px;
}

.mob-nav img {
display: none;
}
}

@media screen and (min-width: 770px) {
.navbar {
display: flex;
flex-direction: row;
gap: 20px;
}

.mob-nav img {
display: none;
}
}

.main-article {
display: flex;
gap: 20px;
margin-bottom: 40px;
align-items: flex-start;
}

.main-article .image img {
width: 100%;
height: auto;
display: block;
}

.main-article .image {
flex: 1;
}
.main-article .content {
flex: 1.5;
}

@media (max-width: 992px) {
.main-article {
flex-direction: column;
}
.main-article .image,
.main-article .content {
width: 100%;
}
}

@media (max-width: 600px) {
.main-article {
gap: 10px;
}

.main-article .content h2 {
font-size: 1.4rem;
}

.main-article .content p {
font-size: 0.95rem;
line-height: 1.5;
}

.main-article .btn {
width: 100%;
}
}

@media screen and (min-width: 480px) and (max-width: 768px) {
.navbar {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.navbar li {
border-bottom: 1px solid white;
width: 100%;
border-right: none;
}

.mob-nav img {
display: none;
}
}

/* */

@media screen and (min-width: 770px) {
.article {
width: 29%;
}
}

@media screen and (min-width: 481px) and (max-width: 769px) {
.article {
width: 48%;
margin-bottom: 20px;
}
}

@media screen and (max-width: 480px) {
.articles-container {
flex-direction: column;
padding: 10px;
}

.article {
width: 100%;
margin-bottom: 15px;
padding: 15px;
}

.article h2 {
font-size: 1.2rem;
}

.article p {
font-size: 0.9rem;
}

.btn {
width: 100%;
padding: 12px;
}
}
26 changes: 18 additions & 8 deletions styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@ html {
box-sizing: border-box;
font-size: 16px;
}

*, *:before, *:after {

*,
*:before,
*:after {
box-sizing: inherit;
}

body, h1, h2, h3, h4, h5, h6, p, ol, ul {

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ol,
ul {
margin: 0;
padding: 0;
font-weight: lighter;
}


/* DO NOT REMOVE - Styling for the label showing the viewport width */
.viewport-dimensions {
position: fixed;
Expand All @@ -27,7 +37,7 @@ body, h1, h2, h3, h4, h5, h6, p, ol, ul {
padding: 5px 8px;
font-size: 14px;
}

/* STYLES */

/* Fonts */
Expand Down Expand Up @@ -80,7 +90,7 @@ header {
list-style-type: none;
width: 100%;
display: flex;
justify-content: flex-start;
justify-content: space-evenly;
}

.navbar li {
Expand Down Expand Up @@ -175,5 +185,5 @@ header {
.btn-blue {
background-color: #007bff;
}

/* Write your CSS below */