From df3976c8def07432f586241e28a3ba99ea99220d Mon Sep 17 00:00:00 2001 From: karunya10 Date: Tue, 8 Jul 2025 16:19:04 +0200 Subject: [PATCH] Ironhacknews 1st commit --- index.html | 2 +- styles/style.css | 145 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 139 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 1b8846b..74beebb 100644 --- a/index.html +++ b/index.html @@ -17,6 +17,7 @@

Ironhack News

  • Sports
  • +
    @@ -71,7 +72,6 @@

    Article 3

    - diff --git a/styles/style.css b/styles/style.css index 9571ab1..68144f7 100644 --- a/styles/style.css +++ b/styles/style.css @@ -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; @@ -27,7 +37,7 @@ body, h1, h2, h3, h4, h5, h6, p, ol, ul { padding: 5px 8px; font-size: 14px; } - + /* STYLES */ /* Fonts */ @@ -75,6 +85,10 @@ header { padding: 10px; border-bottom: 1px solid white; } +.menu-icon { + display: none; + width: 30px; +} .navbar { list-style-type: none; @@ -175,5 +189,122 @@ header { .btn-blue { background-color: #007bff; } - + /* Write your CSS below */ +@media screen and (max-width: 760px) { + .navbar { + flex-direction: column; + align-items: stretch; + } + + .navbar li { + width: 100%; + border-right: none; + border-bottom: 1px solid #ffffff; + } + + .navbar li:last-child { + border-bottom: none; + } + + .main-article { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + } + .main-article .image, + .main-article .content { + width: 100%; + padding: 10px 0; + } + .main-article .content { + padding: 0 15px; + } + .main-article img { + width: 100%; + height: auto; + } + + .articles-container { + display: flex; + flex-direction: column; + } + .article { + width: 100%; + margin-bottom: 20px; + border: 1px solid rgb(148, 147, 147); + align-items: center; + } +} + +@media screen and (min-width: 760px) and (max-width: 1024px) { + .navbar { + display: flex; + padding: 0; + margin: 0; + list-style: none; + } + + .navbar li { + flex: 1 1 0; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + border-right: 1px solid white; + } + + .navbar li:last-child { + border-right: none; + } + + .navbar a { + text-decoration: none; + color: white; + font-weight: bold; + text-align: center; + } + + .main-article { + flex-direction: column; + align-items: center; + text-align: center; + } + + .main-article .image, + .main-article .content { + width: 100%; + padding: 10px; + } + + .main-article .content { + padding-bottom: 20px; + } + + .main-article img { + width: 100%; + height: auto; + } + + .articles-container { + display: flex; + flex-wrap: wrap; + gap: 20px; + justify-content: space-between; + } + .article { + width: 48%; + } +} + +@media screen and (max-width: 480px) { + .navbar { + display: none; + } + .menu-icon { + display: block; + margin: 20px auto; + padding-bottom: 10px; + } +}