From edb1229fa200fad754a8ecb532832b6e28013117 Mon Sep 17 00:00:00 2001 From: Kateryna Soloviova Date: Tue, 17 Jun 2025 19:01:34 +0200 Subject: [PATCH 1/2] Lab CSS News Media Flexbox --- .gitignore | 1 + styles/style.css | 98 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/styles/style.css b/styles/style.css index 9571ab1..193d892 100644 --- a/styles/style.css +++ b/styles/style.css @@ -4,12 +4,23 @@ 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; @@ -27,7 +38,7 @@ body, h1, h2, h3, h4, h5, h6, p, ol, ul { padding: 5px 8px; font-size: 14px; } - + /* STYLES */ /* Fonts */ @@ -175,5 +186,80 @@ header { .btn-blue { background-color: #007bff; } - + /* Write your CSS below */ + +@media(max-width: 760px) { + .navbar { + display: flex; + flex-direction: column; + align-items: center; + border-bottom: 1px solid #ccc; + margin: 0; + padding: 0; + } + + .navbar li { + border-right: none; + border-bottom: 1px solid #ccc; + width: 100%; + } + + .main-article { + display: flex; + flex-direction: column; + align-items: center; + margin: 5; + padding-bottom: 20px; + } + + .main-article .image { + width: 90%; + margin: 15px 15px; + } + + .main-article .content{ + width: 90%; + } + + .articles-container { + display: flex; + flex-direction: column; + align-items: center; + } + + .articles-container article { + margin-bottom: 20px; + width: 100%; + } +} + +@media(min-width: 760px) and (max-width: 1024px) { + .navbar { + display: flex; + flex-direction: row; + align-items: center; + border-top: 1px solid #ccc; + margin: 0; + padding: 0; + justify-content: center; + } + + .navbar li { + border-right: 1px solid #ffffff; + width: 100%; + } + + .articles-container { + display: flex; + flex-direction: row; + align-items: center; + } + + .articles-container article { + margin-bottom: 20px; + width: 40%; + margin-right: 20px; + } + +} \ No newline at end of file From 58b14b4c6fc3e9326acd75a375cbe61d5c59cc7e Mon Sep 17 00:00:00 2001 From: Kateryna Soloviova Date: Tue, 17 Jun 2025 19:16:41 +0200 Subject: [PATCH 2/2] Lab CSS News for max width 480px --- styles/style.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/styles/style.css b/styles/style.css index 193d892..7e91257 100644 --- a/styles/style.css +++ b/styles/style.css @@ -189,6 +189,7 @@ header { /* Write your CSS below */ + @media(max-width: 760px) { .navbar { display: flex; @@ -232,6 +233,12 @@ header { margin-bottom: 20px; width: 100%; } + + @media(max-width: 480px){ + .navbar{ + display:none; + } + } } @media(min-width: 760px) and (max-width: 1024px) {