Problem with strange zoom in the responsiveness - html

It's the first time I make a responsive website, but my media query didn't work as I imagined, the responsiveness didn't work and it got a weird zoom on cell screens. I left it responsive and everything seems to be fine. However, when I open it on cell phones, it comes with an initial zoom that it shouldn't have, but doing the pinching movement to zoom out is as it should, which is responsive on the device. The responsiveness is apparently not bad, but it has this zoom, which I don't know where it comes from. Can anyone tell me what I did wrong, and what could be improved?
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Open Sans', sans-serif;
}
:root{
/* font-size: 62.5%; */
--color-primary: #1f2241;
--color-secondary: #38b6ff;
--color-font: #ffffffe6;
--color-shadow: #AB433F;
}
body{
height: 100%;
/* background-color: var(--color-primary); */
background-color: rgb(217, 85, 80);
font-size: 1.6rem;
font-family: 'open sans', sans-serif;
}
span,
i,
h1{
color: var(--color-font);
}
h1{
font-family: 'Alegreya Sans', Open Sans;
margin-top: 20px;
font-size: 3.2rem;
}
i {
font-size: 3.2rem;
}
section{
display: flex;
align-items: center;
height: 100%;
}
.container{
width: min(42.5rem);
margin-inline: auto;
padding-inline: 2rem;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.container h1{
margin-bottom: 50px;
}
.painel {
display: grid;
grid-template-columns: 1fr 1fr;
text-align: center;
width: 550px;
/* margin-block: 5rem; */
padding: 1rem;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
-webkit-box-shadow: 0px 7px 15px 6px var(--color-shadow);
box-shadow: 0px 7px 15px 6px var(--color-shadow);
}
.painel span{
opacity: .8;
transition: 1s ease-in;
font-weight: bolder;
}
.painel span.active{
opacity: 1;
color: var(--color-secondary);
}
.timer {
display: flex;
justify-content: center;
align-items: center;
height: 200px;
width: 550px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
-webkit-box-shadow: 0px 7px 15px 6px var(--color-shadow);
box-shadow: 0px 7px 15px 6px var(--color-shadow);
font-weight: bolder;
font-size: 60px;
}
.time{
position: relative;
display: flex;
flex-direction: row;
font-size: 60px;
}
.time span{
font-size: 5.6rem;
}
.time span:nth-of-type(2) {
position: relative;
top: -.5rem;
margin-inline: 1rem;
}
.controls {
margin-top: 3rem;
display: flex;
justify-content: space-between;
}
.controls button{
border: none;
background-color: transparent;
cursor: pointer;
}
.controls #stop{
display: none;
margin-right: 15px;
text-decoration: none;
}
.controls #reset{
display: none;
margin-left: 15px;
text-decoration: none;
}
.controls i{
font-size: 25px;
background-color: #48bf91;
background-size: 40px 40px;
border-radius: 50%;
border: 1px solid grey;
padding: 10px;
display: flex;
text-align: center;
}
.controls i:hover{
background-color: #369772;
}
.controls i:active{
background-color: #216e51;
color: rgb(112, 112, 112);
}
.social i{
font-size: 30px;
border: none;
background-color: transparent;
cursor: pointer;
margin: 10px;
}
.social{
margin-top: 8rem;
display: flex;
justify-content: space-between;
}
.content{
background-color: white;
display: flex;
}
.content h1, h2{
color: black;
text-align: center;
/* margin-top: 100px;
margin-bottom: 0; */
}
.content p{
text-align: justify;
margin: 0px 80px;
padding: 40px;
font-size: 20px;
}
.content article{
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.content #text1::after{
content: '';
display: flex;
width: 500px;
height: 0.3rem;
background-color: #38b6ff;
margin: 0 auto;
margin-top: 30px;
margin-bottom: 50px;
position: relative;
justify-content: center;
align-items: center;
border-radius: 10px;
}
footer{
/* background-color: #058effd8; */
background-color: #1f2241;
color: white;
text-align: center;
font-size: 20px;
}
/*RESPONSIVIDADE*/
#media (max-width: 614px){
section{
width: 590px;
}
.content{
width: 606px;
}
.content #text1::after{
width: 300px;
}
.social{
margin-top: 12.8rem;
}
footer{
width: 606px;
}
}
#media (max-width: 550px){
.social{
margin-top: 17.5rem;
}
}
#media (max-width: 500px){
.social{
margin-top: 23.4rem;
}
}
#media (max-width: 450px){
.social{
margin-top: 30.3rem;
}
}
#media (max-width: 400px){
.container{
width: min(42.5rem);
margin-inline: auto;
padding-inline: 2rem;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.container h1{
margin-bottom: 140px;
margin-top: 190px;
}
.painel {
width: 550px;
padding: 1rem;
}
.timer {
height: 400px;
width: 550px;
font-size: 60px;
}
.time{
position: relative;
display: flex;
flex-direction: row;
font-size: 200px;
}
.time span{
font-size: 8rem;
}
.time span:nth-of-type(2) {
position: relative;
top: -.5rem;
margin-inline: 1rem;
}
.social{
margin-top: 39.7rem;
}
.controls i{
font-size: 45px;
background-size: 100px 100px;
}
}
#media (max-width: 337px){
.social{
margin-top: 12.5rem;
}
}
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Alegreya+Sans:wght#400;700&family=Open+Sans:wght#300;400;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<script src="https://kit.fontawesome.com/b41e2a9200.js" crossorigin="anonymous"></script>
<link rel="shortcut icon" href="icons8-whole-apple-16.png" type="image/x-icon">
<title id="titulo">Pomodoro Timer</title>
</head>
<body>
<section>
<div class="container">
<h1>Pomodoro Timer</h1>
<div class="painel">
<span id="work">Work</span>
<span id="break">Break</span>
</div>
<div class="timer">
<div class="box">
<div class="time">
<span id="minutes"></span>
<span>:</span>
<span id="seconds"></span>
</div>
</div>
</div>
<div class="controls">
<button id="start" onclick="start()"><i class="fa-solid fa-play"></i></button>
<a id="stop" href="#" onclick="stop()"><i class="fa-solid fa-stop"></i></a>
<a id="reset" href="#" onclick="reset()"><i class="fa-solid fa-arrow-rotate-left"></i></a>
</div>
<div class="social">
<i class="fab fa-instagram"></i>
<i class="fa-brands fa-github"></i>
<i class="fa-brands fa-linkedin"></i>
</div>
</div>
</section>
<section class="content">
<article>
<div id="text1">
<h1>O que é pomodoro?</h1>
<p>A técnica de pomodoro é uma forma de gerenciamento de tempo, de forma a utilizar melhor o seu tempo e se concentrar melhor no que está fazendo de forma que não se sobrecarregue mentalmente. O sistema incentiva a pessoa a focar de maneira intensa e integral em apenas uma tarefa ao longo de exatos 25 minutos. A técnica foi desenvolvida por Francesco Cirillo no final dos anos 1980. A técnica recebeu esse nome pois Francesco utilizava um cronômetro em forma de tomate, que é Pomodoro em italiano. </p>
</div>
<div>
<h2>Como funciona?</h2>
<p>O sistema pomodoro consiste em 25 minutos de concentração em uma tarefa, seguida de 5 minutos de descanso. Os ciclos de 25 minutos são chamados de Pomodoros, e para organizar melhor a realização da sua tarefa é bom calcular quantos pomodoros serão necessários para a tarefa. Também é aconselhável que a cada 4 ciclos, fazer uma pausa mais longa de 15 a 30 minutos. Esses intervalos entres os pomodoros são fundamentais para “oxigenar o seu cérebro” e aumentar a agilidade mental. O site é tem um design minimalista totalmente voltado para a menor distração possivel, aproveite as funcionalidades e bom trabalho/estudo. 😉 </p>
</div>
</article>
</section>
<footer>
<p>Desenvolvido por ©CarlosCurcino</p>
</footer>
<script src="app.js"></script>
</body>
</html>

Related

Why product-info's height does not scale to card-component?

I'm currently stuck at this, its a picture:
I need both product-info and image heights to be the same, but for some reason using height: 100% in CSS desktop version doesn't works. Maybe giving card-component and especific height would work?. Also any suggestions to my code are welcomed, specifly with responsive design's stuff.
I'm new with CSS and I'm doing this for practice.
This is my HTML and CSS code:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght#500;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght#9..144,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./styles.css">
<link rel="stylesheet" href="./desktop.css" media="screen and (min-width: 530px)">
<title>Product preview card component</title>
</head>
<body>
<main>
<div class="card-component">
<figure class="image-container">
<picture>
<source media="(min-width: 530px)" srcset="./images/image-product-desktop.jpg">
<img src="./images/image-product-mobile.jpg" class="card-component__image" alt="product image">
</picture>
</figure>
<div class="card-component__product-info">
<span>PERFUME</span>
<div class="card-component__product-description">
<h1>Gabrielle Essence Eau De Parfum</h1>
<p>
A floral, solar and voluptuos
interpretation composed by Oliver
Polge, Perfumer-Creator for the House
of CHANEL.
</p>
</div>
<div class="card-component__price">
<h1>$149.99</h1>
<p>$169.99</p>
</div>
<button class="card-button">
<img src="./images/icon-cart.svg" alt="cart icon">
Add to Cart
</button>
</div>
</div>
</main>
</body>
</html>
CSS: Mobile
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--dark-cyan: hsl(158, 36%, 37%);
--cream: hsl(30, 38%, 92%);
--very-dark-blue: hsl(212, 21%, 14%);
--dark-grayish-blue: hsl(228, 12%, 48%);
--white: hsl(0, 0%, 100%);
}
html {
font-size: 62.5%;
}
body {
font-size: 1.4rem;
}
main {
display: grid;
place-items: center;
width: 100%;
height: 100vh;
background-color: var(--cream);
}
.card-component {
width: 92.5%;
height: auto;
max-width: 700px;
display: flex;
flex-direction: column;
align-items: center;
}
.card-component .image-container {
width: 100%;
height: auto;
}
.card-component .card-component__image {
max-width: 100%;
max-height: 100%;
display: block;
border-radius: 1rem 1rem 0 0;
}
.card-component__product-info {
font-family: "Montserrat";
color: var(--dark-grayish-blue);
width: 100%;
height: auto;
background-color: var(--white);
padding: 0 2.5rem;
border-radius: 0 0 1rem 1rem;
}
.card-component__product-info span {
display: block;
letter-spacing: 0.5rem;
font-size: 1.2rem;
margin-bottom: 1rem;
margin-top: 2rem;
}
.card-component__product-description {
margin-bottom: 2rem;
}
.card-component__product-description h1 {
font-family: "Fraunces";
font-weight: bold;
font-size: 3.4rem;
line-height: 3.5rem;
color:black;
margin-bottom: 1.5rem;
}
.card-component__product-description p {
line-height: 2.5rem;
}
.card-component__price {
display: flex;
align-items: center;
margin-bottom: 1.5rem;
}
.card-component__price h1 {
font-family: "Fraunces";
font-weight: bold;
font-size: 3.4rem;
color: var(--dark-cyan);
margin-right: 2rem;
}
.card-component__price p {
text-decoration: line-through;
}
.card-button {
width: 100%;
height: 4.5rem;
margin-bottom: 2.5rem;
font-family: "Montserrat";
font-weight: bold;
color: var(--white);
border: none;
background-color: var(--dark-cyan);
border-radius: 0.8rem;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
.card-button img {
margin-right: 1rem;
}
.card-button:hover {
background-color: var(--very-dark-blue);
}
CSS:Desktop
.card-component {
flex-direction: row;
}
.card-component .card-component__image {
border-radius: 1rem 0 0 1rem;
}
.card-component__product-info{
display: flex;
flex-direction: column;
justify-content: space-evenly;
height: 100%;
border-radius: 0 1rem 1rem 0;
}

Debugging Flexbox - What am I missing?

I've been working on this project and I am fully stuck on ensuringing both cards (the image and the project content) are on the same row when displayed on desktop. After a few days, I admit I need help.
Can anyone tell me where I've gone wrong and how I can solve this using flexbox correctly because I am going crosseyed trying to figure it out.
Below is a photo of what it's supposed to look like in desktop.
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
align-items: center;
background-color: hsl(30, 38%, 92%);
color: hsl(228, 12%, 48%);
display: flex;
font-family: 'Montserrat', sans-serif;
font-size: 0.875em;
justify-content: center;
height: 100vh;
}
h1 {
color: black;
font-family: 'Fraunces', serif;
font-size: 1.875em;
}
h3 {
font-size: 0.75em;
font-weight: 500;
letter-spacing: 7px;
text-transform: uppercase;
}
p {
font-size: 0.75em;
line-height: 1.7;
}
/* ------ ENTIRE CONTAINER --------- */
#card-container {
align-items: center;
justify-content: center;
/* flex-wrap: wrap; */
flex-direction: row;
width: 700px;
margin: 0 auto;
}
#card-container row {
display: flex;
flex-direction: row;
margin: 0;
}
#media screen and (max-width : 667px) {
#container {
border-radius: 10px 0 10px 0;
height: 39.7em;
width: 22.8em;
}
}
/* ------ LEFT CONTAINER w/ IMAGE --------- */
.image {
background-image: url(images/image-product-desktop.jpg);
background-repeat: no-repeat;
background-size: contain;
border-radius: 10px 0 0 10px;
height: 394px;
max-width: 50%;
margin-right: 0;
display: flex;
flex-direction: row;
}
#media screen and (max-width : 667px) {
.image {
background-image: url(images/image-product-mobile.jpg);
border-radius: 10px 10px 0 0;
height: 230px;
width: 50%;
margin: 0 auto;
}
}
/* ------RIGHT CONTAINER w/ CONTENT --------- */
.right-container {
background-color: white;
border-radius: 0 10px 10px 0;
height: 450px;
padding: 2em;
width: 50%;
}
#media screen and (max-width : 667px) {
.right-container {
border-bottom-left-radius: 10px;
border-top-right-radius: 0px;
padding: 30px 30px 5px;
width: 50%;
margin: 0 auto;
}
}
.right-container h1 {
margin: auto auto 7% auto;
}
.right-container h3 {
padding-bottom: 1em;
padding-top: 1.9em;
}
.right-container p {
padding-right: 2em;
padding-top: 1.1em;
}
/* ------ PRICES --------- */
.price-container h1 {
color: hsl(158, 36%, 37%);
display: inline-block;
margin-top: 20%;
}
.price-container p {
display: inline-block;
margin-left: 5em;
text-decoration: line-through;
}
/* ------- ADD TO CART --------- */
.cart-btn {
background-color: hsl(158, 36%, 37%);
background-position: 4em;
background-repeat: no-repeat;
border-radius: 10px;
border: transparent;
color: white;
font-family: 'Montserrat', sans-serif;
font-size: 15px;
padding: 4% 32%;
}
.cart-btn:hover {
background-color: black;
cursor: pointer;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<title>Product preview card component</title>
<!-- CSS STYLESHEET-->
<link rel="stylesheet" href="styles.css">
<!-- GOOGLE FONTS -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght#9..144,700&family=Montserrat:wght#500;700&display=swap"
rel="stylesheet">
</head>
<body>
<section class="card-container">
<div class="row">
<div class="image">
<div class="img-desktop"></div>
<div class="img-mobile"></div>
</div>
</div>
<div class="row">
<div class="right-container">
<h3>Perfume</h3>
<h1>Gabrielle Essence Eau De Parfum</h1>
<p>A floral, solar and voluptuous interpretation composed by Olivier Polge,
Perfumer-Creator for the House of CHANEL.</p>
<div class="price-container">
<h1>$149.99</h1>
<p>$169.99</p>
</div>
<div class="cart-container">
<img src="./images/icon-cart.svg" alt="card-img">
<button class="cart-btn">Add to Cart</button>
</div>
</div>
</div>
</section>
</body>
</html>
To solve this I simply put the element with the background-image in a new div called .left-container. I removed the use of two .row's and put them in one row and set it to display: flex;. I then used Font Awesome for your shopping cart icon.
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
align-items: center;
background-color: hsl(30, 38%, 92%);
color: hsl(228, 12%, 48%);
display: flex;
font-family: 'Montserrat', sans-serif;
font-size: 0.875em;
justify-content: center;
height: 100vh;
}
h1 {
color: black;
font-family: 'Fraunces', serif;
font-size: 1.875em;
}
h3 {
font-size: 0.75em;
font-weight: 500;
letter-spacing: 7px;
text-transform: uppercase;
}
p {
font-size: 0.75em;
line-height: 1.7;
}
.row {
display: flex;
}
/* ------ ENTIRE CONTAINER --------- */
#card-container {
align-items: center;
justify-content: center;
/* flex-wrap: wrap; */
flex-direction: row;
width: 700px;
margin: 0 auto;
}
#card-container row {
display: flex;
flex-direction: row;
margin: 0;
}
/* ------ LEFT CONTAINER w/ IMAGE --------- */
.left-container {
width: 50%;
height: 450px;
}
.image {
background-image: url(https://i.picsum.photos/id/487/200/300.jpg?grayscale&hmac=j_GpFy8cDZyFmRD6sSG09M39jrZwpW3dCYWYnWlC1Vo);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
height: 100%;
width: 100%;
border-radius: 10px 0 0 10px;
margin-right: 0;
display: flex;
flex-direction: row;
}
/* ------RIGHT CONTAINER w/ CONTENT --------- */
.right-container {
background-color: white;
border-radius: 0 10px 10px 0;
height: 450px;
padding: 2em;
width: 50%;
display: flex;
flex-flow: column;
justify-content: space-around;
}
.right-container h3 {
padding-bottom: 1em;
padding-top: 1.9em;
}
.right-container p {
padding-right: 2em;
padding-top: 1.1em;
}
/* ------ PRICES --------- */
.price-container h1 {
color: hsl(158, 36%, 37%);
display: inline-block;
margin-top: 20%;
}
.price-container p {
display: inline-block;
margin-left: 5em;
text-decoration: line-through;
}
/* ------- ADD TO CART --------- */
.cart-btn {
background-color: hsl(158, 36%, 37%);
background-position: 4em;
background-repeat: no-repeat;
border-radius: 10px;
border: transparent;
color: white;
font-family: 'Montserrat', sans-serif;
font-size: 15px;
width: 100%;
padding: 1em;
}
.cart-btn:hover {
background-color: black;
cursor: pointer;
}
i {
color: white;
}
.card-container {
display: flex;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- displays site properly based on user's device -->
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<title>Product preview card component</title>
<!-- CSS STYLESHEET-->
<link rel="stylesheet" href="styles.css">
<!-- GOOGLE FONTS -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<script src="https://kit.fontawesome.com/6140596fcb.js" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght#9..144,700&family=Montserrat:wght#500;700&display=swap" rel="stylesheet">
</head>
<body>
<section class="card-container">
<div class="row">
<div class="left-container">
<div class="image">
<div class="img-desktop"></div>
<div class="img-mobile"></div>
</div>
</div>
<div class="right-container">
<h3>Perfume</h3>
<h1>Gabrielle Essence Eau De Parfum</h1>
<p>A floral, solar and voluptuous interpretation composed by Olivier Polge, Perfumer-Creator for the House of CHANEL.</p>
<div class="price-container">
<h1>$149.99</h1>
<p>$169.99</p>
</div>
<div class="cart-container">
<button class="cart-btn"><i class="fa-solid fa-cart-shopping"></i>
Add to Cart</button>
</div>
</div>
</div>
</section>
</body>
</html>
I have made my self page that replicates the solution you want, I have done minimal styling to make you understand how flexbox properties in CSS work (NOTE: I have not made it responsive so try to have a look on desktop view). Refer to my solution and ask question(s) if you are facing any doubts.
* {
margin: 0;
padding: 0;
}
.card-container {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
background-color: hsl(30, 38%, 92%);
color: hsl(228, 12%, 48%);
font-family: "Montserrat", sans-serif;
font-size: 0.875em;
}
#random-image {
height: 100%;
width: 100%;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
}
.intermediate-container {
display: flex;
width: 60%;
height: 50%;
border-radius: 8px;
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.55);
}
.left-container {
width: 50%;
}
.right-container {
width: 50%;
padding: 10px;
background-color: white;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="styles.css" />
<title>Your title</title>
</head>
<body>
<section class="card-container">
<div class="intermediate-container">
<div class="left-container">
<img
id="random-image"
src="https://hatrabbits.com/wp-content/uploads/2017/01/random.jpg"
/>
</div>
<div class="right-container">
<div>
<h3>Perfume</h3>
<h1>Gabrielle Essence Eau De Parfum</h1>
<p>
A floral, solar and voluptuous interpretation composed by Olivier
Polge, Perfumer-Creator for the House of CHANEL.
</p>
<div class="price-container">
<h1>$149.99</h1>
</div>
<div class="cart-container">
<button class="cart-btn">
<i class="fa-solid fa-cart-shopping"></i> Add to Cart
</button>
</div>
</div>
</div>
</div>
</section>
</body>
</html>
#card-container row <- use proper selector (.row)
and from given information I can only predict that

Center menu, center pictures, HTML, CSS

Good morning. I'm new to html/css and to programming in general and this is my first post. Below is my current code. I'd like to do three things, that I'm currently unable to do:
to center the purple menu with the four boxes: I've tried to move the nav bar inside the header, but without success.
to put in a single line the card with red wine and white wine and below them, the other two. I've created two DIV parent directories, each with two childs.
to put the "comprar" (to buy) button below each picture.
Thank you very much in advance.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vinería Baco</title>
<!--link css-->
<link rel="stylesheet" href="./estilos.css">
</head>
<body>
<!--seccion hero/banner-->
<header>
<p><h1 class="h1_rojo">Vinería Baco</h1></p>
<p><h2 class="h2_turquesa">El mejor vino de todo Berisso</h2></p>
<!--Menu de navegacion-->
<nav>
<ul>
<li class="menu menu__item">Contactanos</li>
<li class="menu menu__item">Facebook</li>
<li class="menu menu__item">Instagram</li>
<li class="menu menu__item">Acerca de nosotros</li>
</ul>
</nav>
</header>
<!--Seccion main-->
<main>
<!--cards 1 to 2-->
<div class="card1">
<img alt="vino tinto" src="../img/tintos/tintos.jpg"width=150" height="70"><button type="button">Comprar</button><br>
<img alt="vino blanco" src="../img/blancos/blancos.jpg"width=150" height="70"><button type="button">Comprar</button><br>
<!--cards 3 to 4-->
<div class="card2">
<img alt="vino rosado" src="../img/rosados/rosados.jpg"width=150" height="70"><button type="button">Comprar</button><br>
<img alt="vinos especiales" src="../img/especiales/especiales.jpg"width=150" height="70"><button type="button">Comprar</button><br></div>
</main><br><br>
<!--Seccion footer-->
<footer>
<h4>2021 | Hecho por MGP | 2021</h4>
</footer>
</body>
</html>
CSS:
/*HERO SECTION*/
/*Encabezados*/
.h1_turquesa {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color:#00868b;
text-align: center;
}
.h1_rojo {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color:#8b0000;
text-align: center;
}
.h1_azul {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color:rgb(138, 43, 226);
text-align: center;
}
.h1_verde {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color: rgb(0, 128, 0);
text-align: center;
}
h2 {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color:rgb(139, 0, 139);
text-align: center;
}
/*Párrafos*/
.parr {
display: block;
font-size: 18px;
color: black;
text-align: justify;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
}
/*Fondo*/
body {
background-color: rgb(197, 189, 170);
}
/*Imágenes*/
img {
display: block;
max-width:500px;
max-height:500px;
width: auto;
height: auto;
}
/*MENU*/
.menu {
background-color: rgb(175, 76, 122);
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-family: monospace;
font-size: 16px;
}
.menu__item a {
text-decoration: none;
color: white;
}
/*MAIN*/
/*Card section*/
.card1{
display: flex;
background-color: rgb(197, 189, 170);
width: 90%;
margin: 10px;
margin: 10px;
width: 60%;
justify-content: space-between;
align-items: center;
}
.card2{
display: flex;
background-color: rgb(197, 189, 170);
width: 90%;
margin: 10px;
margin: 10px;
width: 60%;
justify-content: space-between;
align-items: center;
}
button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
/*FOOTER*/
footer{
display: flex;
justify-content: center;
align-items: center;
padding: 50px 0px;
}
Welcome to Stack Overflow. I would suggest running your code through a beautifier to clean up everything and you can see if you accidentally forgot to close a tag. In your instance, you forgot to close one of your div tags which I closed for you. I also nested both of your divs card1 and card2 into a card-container. I went ahead and flexed that div with and justified it to the center. I also added a .flex class to align your unordered list into the center. Please see those changes below. I am unsure what you mean about part 2 of your question, if you can please elaborate further.
/*HERO SECTION*/
/*Encabezados*/
.h1_turquesa {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color:#00868b;
text-align: center;
}
.h1_rojo {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color:#8b0000;
text-align: center;
}
.h1_azul {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color:rgb(138, 43, 226);
text-align: center;
}
.h1_verde {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color: rgb(0, 128, 0);
text-align: center;
}
h2 {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
color:rgb(139, 0, 139);
text-align: center;
}
/*Párrafos*/
.parr {
display: block;
font-size: 18px;
color: black;
text-align: justify;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
}
/*Fondo*/
body {
background-color: rgb(197, 189, 170);
}
/*Imágenes*/
img {
display: block;
max-width:500px;
max-height:500px;
width: auto;
height: auto;
}
/*MENU*/
.menu {
background-color: rgb(175, 76, 122);
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-family: monospace;
font-size: 16px;
}
.menu__item a {
text-decoration: none;
color: white;
}
/*MAIN*/
/*Card section*/
.card1{
display: flex;
flex-direction: column;
background-color: rgb(197, 189, 170);
width: 90%;
margin: 10px;
margin: 10px;
width: 60%;
justify-content: space-between;
align-items: center;
}
.card2{
display: flex;
flex-direction: column;
background-color: rgb(197, 189, 170);
width: 90%;
margin: 10px;
margin: 10px;
width: 60%;
justify-content: space-between;
align-items: center;
}
button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
/*FOOTER*/
footer{
display: flex;
justify-content: center;
align-items: center;
padding: 50px 0px;
}
.flex {
display: flex;
justify-content: center;
}
.card-container {
display: flex;
justify-content: center;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vinería Baco</title>
<!--link css-->
<link rel="stylesheet" href="./estilos.css">
</head>
<body>
<!--seccion hero/banner-->
<header>
<p><h1 class="h1_rojo">Vinería Baco</h1></p>
<p><h2 class="h2_turquesa">El mejor vino de todo Berisso</h2></p>
<!--Menu de navegacion-->
<nav>
<ul class="flex">
<li class="menu menu__item">Contactanos</li>
<li class="menu menu__item">Facebook</li>
<li class="menu menu__item">Instagram</li>
<li class="menu menu__item">Acerca de nosotros</li>
</ul>
</nav>
</header>
<!--Seccion main-->
<main>
<!--cards 1 to 2-->
<div class="card-container">
<div class="card1">
<img alt="vino tinto" src="https://dummyimage.com/600x350/000/fff"width=150" height="70"><br><button type="button">Comprar</button><br>
<img alt="vino blanco" src="https://dummyimage.com/600x350/000/fff" width=150" height="70"><br><button type="button">Comprar</button><br>
</div>
<!--cards 3 to 4-->
<div class="card2">
<img alt="vino rosado" src="https://dummyimage.com/600x350/000/fff"width=150" height="70"><br><button type="button">Comprar</button><br>
<img alt="vinos especiales" src="https://dummyimage.com/600x350/000/fff"width=150" height="70"><br><button type="button">Comprar</button><br>
</div>
</main><br><br>
</div>
<!--Seccion footer-->
<footer>
<h4>2021 | Hecho por MGP | 2021</h4>
</footer>
</body>
</html>
EDIT: inserted dummy images into HTML. It appears buttons are displaying below the images as expected.
There's a mindset that always help me out.
If you have problems positioning something, create a div parent.
I create as many div parents as needed.
For example:
<div>
<div>My element 1</div>
<div>My element 2</div>
<div>My element 3</div>
<div>My element 4</div>
</div>
Sometimes I might want that the first two elements get positioned differently, so I create another parent that will wrap the elements I want to position in a different way.
<div>
<div>
<div>My element 1</div>
<div>My element 2</div>
</div>
<div>
<div>My element 3</div>
<div>My element 4</div>
</div>
</div>
If you do that, it will solve many problems

Symmetry problem with the CSS I apply to an element on the right of my navbar

I would like to decrease the space between my different social networks and by making :
margin: 2px; or padding: 2px;
It doesn't apply any change: how to apply a change between my different icons for my social networks please?
I would like to reduce the spacing between my 3 icons, here is a screen to illustrate my words, if you did not understand even if I think I have correctly explained the problem I will answer in comment, thank you in advance (If you have understood and you want to help me I am interested if you have explanations, I am trying to improve and it's been a few days that I block on this problem): The screen to illustrate my words: https://prnt.sc/13n7pss
If you see other things wrong in my code like this I'm interested, I'm a beginner and I don't necessarily have the best ways to develop so if you think I can improve it don't hesitate to tell me etc. Thank you very much
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Poseidon | The Perfect Discord Bot</title>
<link rel="stylesheet" href="main.css">
<link rel="icon" type="image/svg+xml" href="img/favicon.svg">
</head>
<body>
<header class="topbar">
<img class="header-logo" src="img/logo.svg" alt="Poseidon Logo" href="index.html">
<nav>
<div class="middle">
Invite
Commands
Documentation
Premium
Support
</div>
<div class="right">
<img src="https://img.icons8.com/windows/32/000000/github.png"/>
<img src="https://img.icons8.com/material-rounded/32/000000/discord-logo.png"/>
<img src="https://img.icons8.com/android/32/000000/twitter.png"/>
</div>
</nav>
</header>
<div class="circuit">
<h1>The Perfect Discord Bot.</h1>
<h2>Poseidon is the only Discord bot you'll ever need!</h2>
</div>
<div class="dark">
<h1>The Perfect Discord Bot.</h1>
<h2>Poseidon is the only Discord bot you'll ever need!</h2>
</div>
<div class="dark">
<h1>The Perfect Discord Bot.</h1>
<h2>Poseidon is the only Discord bot you'll ever need!</h2>
</div>
<div class="dark">
<h1>The Perfect Discord Bot.</h1>
<h2>Poseidon is the only Discord bot you'll ever need!</h2>
</div>
<div class="circuit">
<h1>The Perfect Discord Bot.</h1>
<h2>Poseidon is the only Discord bot you'll ever need!</h2>
</div>
<div id="footer">
<div class="logo">
<div class="flex">
<img class="img" src="img/white.svg" alt="Poseidon Logo" href="index.html">
</div>
<div class="copyright">© Poseidon Bot 2012 - All Rights Reserved.</div>
</div>
<ul class="product">
<li><b>Product</b></li>
<li>Invite</li>
<li>Commands</li>
<li>Premium</li>
</ul>
<ul class="resources">
<li><b>Resources</b></li>
<li>Docs</li>
<li>Provacy</li>
<li>Refunds</li>
</ul>
<ul class="business">
<li><b>Business</b></li>
<li>Contact</li>
</ul>
<div class="design">
designed with <span style="color: red;">❤</span> by <span style="color: #065299;">My Discord Id</span></div>
</div>
<div class="social"><img src="https://img.icons8.com/material-sharp/24/ffffff/github.png" /></div>
<div class="social"><img src="https://img.icons8.com/android/24/ffffff/twitter.png" /></div>
<div class="social"><img src="https://img.icons8.com/material-sharp/24/ffffff/discord-logo.png" /></div>
</div>
</div>
</body>
</html>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body, html {
font-size: 16px;
color: rgba(0, 0, .87);
font-family: "Montserrat", sans serif;
line-height: 1.6;
margin: 0;
padding: 0;
font-weight: 500;
width: 100%;
}
.circuit {
background-image: url(img/background.svg);
background-color: rgba(62,62,62, 1);
padding: 192px 0 112px;
}
.dark {
background-color: rgb(35,35,35);
padding: 192px 16px;
}
.topbar {
height: 80px;
background-color: #fff;
box-shadow: 0 8px 15px rgba(0, 0, 0, .05);
display: flex;
align-items: center;
width: 100%;
}
.topbar nav {
display: flex;
width: 100%;
}
.middle {
margin: 0 auto;
}
.topbar nav a {
color: #9F9F9F;
text-decoration: none;
font-weight: 500;
padding: 0 20px;
display: inline-block;
text-align: center;
}
.topbar nav a:hover, .topbar nav a.active {
color: #000;
}
.right {
cursor: pointer;
display: flex;
}
.header-logo {
cursor: pointer;
width: 25vh;
}
h1 {
text-align: center;
color: #fff;
}
#footer {
font-family: sans-serif;
display: grid;
height: 20%;
background-color: black;
color: white;
grid-template-rows: 1fr;
grid-template-columns: 2fr .6fr .6fr 1fr;
grid-template-areas: "logo product resources business";
}
li {
list-style: none;
padding-top: 8%;
font-size: .9em;
line-height: 1px;
}
.flex {
display: flex;
}
#footer li a {
color: rgb(22,145,176);
text-decoration: none;
}
.logo {
display: flex;
flex-direction: column;
justify-content: flex-start;
grid-area: logo;
padding-left: 1rem;
padding-top: .5rem;
}
.img {
padding-top: .5rem;
width: 25vh;
cursor: pointer;
}
.logo h4 {
line-height: 1rem;
margin-left: 2rem;
}
.copyright {
padding-top: .3rem;
font-size: 1em;
color: rgb(97,97,97);
}
.product {
grid-area: product;
font-size: 20px;
}
.resources {
grid-area: resources;
font-size: 20px;
}
.business {
grid-area: business;
font-size: 20px;
}
.social {
grid-area: social;
padding-left: .3rem;
padding-bottom: .3rem;
font-size: .6em;
}
.design {
grid-area: design;
font-size: 1em;
text-align: right;
padding-right: .5rem;
padding-bottom: 1rem;
}
Here you go...
Add this to your CSS:
.right a {
margin-right: -10%;
}
If you want to decrease white space between your icons, you need to set negative margin-right (not positive!). Positive margin-right will do exactly the opposite that you want to achieve.
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body,
html {
font-size: 16px;
color: rgba(0, 0, .87);
font-family: "Montserrat", sans serif;
line-height: 1.6;
margin: 0;
padding: 0;
font-weight: 500;
width: 100%;
}
.circuit {
background-image: url(img/background.svg);
background-color: rgba(62, 62, 62, 1);
padding: 192px 0 112px;
}
.dark {
background-color: rgb(35, 35, 35);
padding: 192px 16px;
}
.topbar {
height: 80px;
background-color: #fff;
box-shadow: 0 8px 15px rgba(0, 0, 0, .05);
display: flex;
align-items: center;
width: 100%;
}
.topbar nav {
display: flex;
width: 100%;
}
.middle {
margin: 0 auto;
}
.topbar nav a {
color: #9F9F9F;
text-decoration: none;
font-weight: 500;
padding: 0 20px;
display: inline-block;
text-align: center;
}
.topbar nav a:hover,
.topbar nav a.active {
color: #000;
}
.right {
cursor: pointer;
display: flex;
}
.right a {
margin-right: -10%;
}
.header-logo {
cursor: pointer;
width: 25vh;
}
h1 {
text-align: center;
color: #fff;
}
#footer {
font-family: sans-serif;
display: grid;
height: 20%;
background-color: black;
color: white;
grid-template-rows: 1fr;
grid-template-columns: 2fr .6fr .6fr 1fr;
grid-template-areas: "logo product resources business";
}
li {
list-style: none;
padding-top: 8%;
font-size: .9em;
line-height: 1px;
}
.flex {
display: flex;
}
#footer li a {
color: rgb(22, 145, 176);
text-decoration: none;
}
.logo {
display: flex;
flex-direction: column;
justify-content: flex-start;
grid-area: logo;
padding-left: 1rem;
padding-top: .5rem;
}
.img {
padding-top: .5rem;
width: 25vh;
cursor: pointer;
}
.logo h4 {
line-height: 1rem;
margin-left: 2rem;
}
.copyright {
padding-top: .3rem;
font-size: 1em;
color: rgb(97, 97, 97);
}
.product {
grid-area: product;
font-size: 20px;
}
.resources {
grid-area: resources;
font-size: 20px;
}
.business {
grid-area: business;
font-size: 20px;
}
.social {
grid-area: social;
padding-left: .3rem;
padding-bottom: .3rem;
font-size: .6em;
}
.design {
grid-area: design;
font-size: 1em;
text-align: right;
padding-right: .5rem;
padding-bottom: 1rem;
}
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Document</title>
</head>
<body>
<header class="topbar">
<img class="header-logo" src="img/logo.svg" alt="Poseidon Logo" href="index.html">
<nav>
<div class="middle">
Invite
Commands
Documentation
Premium
Support
</div>
<div class="right">
<img src="https://img.icons8.com/windows/32/000000/github.png" />
<img src="https://img.icons8.com/material-rounded/32/000000/discord-logo.png" />
<img src="https://img.icons8.com/android/32/000000/twitter.png" />
</div>
</nav>
</header>
</body>
</html>

Website looks off when working on a smaller screen

I need my work done soon, but I don't have access to my bigger monitor. I assume the teacher also has a big monitor where he'll look at my work, so it shouldn't be a problem.
But my site only looks normal on 70% and I'm having a big headache trying to make it work so I have to work on 70%.
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
}
header {
display: flex;
width: 50%;
height: 8vh;
margin: auto;
align-items: center;
}
.nav-links,
.search-container {
display: flex;
}
nav {
position: relative;
flex: 1;
}
.nav-links {
justify-content: space-evenly;
max-width: 300px;
list-style: none;
}
.nav-link {
color: #ffffff;
font-size: 18px;
text-decoration: none;
}
.search-container {
flex: 1;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 0;
}
#justdance {
display: flex;
width: 50%;
margin: auto;
align-items: top;
}
.about {
background-color: #c4c4c4;
display: flex;
width: 50%;
height: 30vh;
margin: auto;
flex-direction: column;
align-items: flex-start;
}
.quote {
text-align: center;
display: block;
border-radius: 10px;
border-style: solid;
box-shadow: rgba(0, 0, 0, 0.42) 0px 2px 2px 0px;
width: 500px;
height: 30px;
margin: 20px auto 0 auto;
}
.description {
margin: 30px auto 0 auto;
text-align: justify;
width: 70%;
font-size: 13px;
}
.sideimage {
position: absolute;
right: 640px;
top: 390px;
}
.polygon {
position: absolute;
right: 960px;
bottom: 260px;
width: 0;
height: 0;
border-top-width: 82px;
border-top-style: solid;
border-top-color: transparent;
border-right-width: 90px;
border-right-style: solid;
border-right-color: #c4c4c4;
transform: rotate(-180deg);
}
.piirkonnad {
background-color: #222222;
display: flex;
width: 50%;
height: 29vh;
margin: auto;
flex-direction: column;
align-items: flex-start;
}
.piirkonnad p {
position: absolute;
left: 554px;
bottom: 270px;
font-family: Roboto;
font-style: italic;
font-weight: 300;
font-size: 20px;
line-height: 23px;
color: #FFFFFF;
}
.copyright p {
position: absolute;
right: 803px;
bottom: 24px;
font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 13px;
line-height: 12px;
color: #FFFFFF;
}
.social {
position: absolute;
right: 550px;
bottom: -2px;
}
.fa {
padding: 15px;
font-size: 30px;
width: 50px;
text-align: center;
text-decoration: none;
margin: 5px 2px;
border-radius: 50%;
}
.fa-instagram {
background: #c4c4c4;
color: black;
}
.fa-twitter {
background: #c4c4c4;
color: black;
}
.fa-facebook {
background: #c4c4c4;
color: black;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
<title>Just Dance</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<style>
body {
background-color: #000000;
}
</style>
<body>
<header>
<nav>
<ul class="nav-links">
<li><a class="nav-link" href="#">Avaleht</a></li>
<li><a class="nav-link" href="#">Meist</a></li>
<li><a class="nav-link" href="#">Login</a></li>
</ul>
<div class="search-container">
<input type="text" placeholder="Otsing" name="search">
</div>
</nav>
</header>
<main>
<img src="header.jpg" alt="Just Dance" id="justdance" ;>
<div class="about">
<div class="quote">“Dance is the hidden language of the soul” - Marta Graham</div>
<div class="description">
<div class="text">
<p>Kunagi pole liiga hilja alustada. Just Dance veebilehelt leiad<br>
tantsukursusi üle Eesti.</p>
<br>
<p>Sulle sobiva kursuse leidmine on imelihtne - vali piirkond või<br>
tantsustiil ning sulle avaneb loetelu kursustest.</p>
<br>
<p>Ka tantsukaaslaste leidmine on imelihtne. Kirjuta sulle sobiva<br>
kursuse kommentaaridesse oma kaaslaseotsingust ning jää<br>
ootama vastust. Ehk leiad juba homme oma unelmate partneri?<br>
Kursuste kommenteerimiseks registreeru "Just Dance" kasutajaks.</p>
</div>
<div class="sideimage">
<img src="dancers.png" alt="Dancers" id="dancer" ;>
</div>
<div class="polygon"></div>
</div>
</main>
<section>
<div class="piirkonnad">
<p>Piirkonnad</p>
</div>
<div class="row1">
<img src="1.jpg" alt="Harjumaa" width="170" height="100">
</div>
</section>
<footer>
<div class="copyright">
<p>Just Dance © Noor Meister Kõik õigused kaitstud</p>
</div>
<div class="social">
</div>
</footer>
</body>
</html>
I've heard about responsive design already, but I can't figure it out. I'm not the greatest at coding and it was hard to achieve what I have so help is appreciated a ton.
Your code has some mistakes on it, you have ; on your img element and your style element should be in the head tag, and the reason why your website is not responsive is because you are using position:absolute, keep your website simple, or if you really want to still use position:absolute, then that div should be contained on another div but set it it to position:relative.
Anyways, I fixed it and now totally responsive, here it is:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
padding-top:20px;
}
header{
display:flex;
justify-content:space-evenly;
width: 50%;
margin: auto;
flex-wrap:wrap;
}
.nav-links{
display: flex;
}
.nav-links{
justify-content: space-evenly;
max-width: 300px;
list-style: none;
}
.nav-link{
color: #ffffff;
font-size: 18px;
padding:10px;
text-decoration: none;
}
#justdance {
display: flex;
width: 50%;
margin: auto;
align-items: top;
}
.about {
padding:10px;
background-color: #c4c4c4;
width: 50%;
margin: auto;
}
.search-container{
min-width:30px
}
.quote {
text-align: center;
display: block;
border-radius: 10px;
border-style: solid;
box-shadow: rgba(0, 0, 0, 0.42) 0px 2px 2px 0px;
padding:5px;
margin: 10px auto 0 auto;
}
.description {
margin: 30px auto 0 auto;
width: 70%;
font-size: 13px;
}
.polygon {
height: 0;
border-top-width: 82px;
border-top-style: solid;
border-top-color: transparent;
border-right-width: 90px;
border-right-style: solid;
border-right-color: #c4c4c4;
transform: rotate(-180deg);
}
.piirkonnad {
position:relative;
display:flex;
background-color: #222222;
display: flex;
width: 50%;
padding-top:30px;
height: 29vh;
margin: auto;
justify-content:space-evenly;
}
.piirkonnad p {
text-align:center;
font-family: Roboto;
font-style: italic;
font-weight: 300;
font-size: 20px;
line-height: 23px;
color: #FFFFFF;
}
footer{
margin-top:1em;
}
.copyright p {
text-align:center;
font-family: Roboto;
font-style: normal;
font-weight: normal;
font-size: 13px;
line-height: 12px;
color: #FFFFFF;
}
.social {
display:flex;
justify-content:center;
}
.fa {
padding: 15px;
font-size: 30px;
width: 50px;
text-align: center;
text-decoration: none;
margin: 5px 2px;
border-radius: 50%;
}
.fa-instagram {
background: #c4c4c4;
color: black;
}
.fa-twitter {
background: #c4c4c4;
color: black;
}
.fa-facebook {
background: #c4c4c4;
color: black;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
<title>Just Dance</title>
<link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body {
background-color: #000000;
}
</style>
</head>
<body>
<header>
<nav>
<ul class="nav-links">
<li><a class="nav-link" href="#">Avaleht</a></li>
<li><a class="nav-link" href="#">Meist</a></li>
<li><a class="nav-link" href="#">Login</a></li>
</ul>
</nav>
<div class="search-container">
<input type="text" placeholder="Otsing" name="search">
</div>
</header>
<main>
<img src="header.jpg" alt="Just Dance" id="justdance">
<div class="about">
<div class="quote">“Dance is the hidden language of the soul” - Marta Graham</div>
<div class="description">
<div class="text">
<p>Kunagi pole liiga hilja alustada. Just Dance veebilehelt leiad<br>
tantsukursusi üle Eesti.</p>
<br>
<p>Sulle sobiva kursuse leidmine on imelihtne - vali piirkond või<br>
tantsustiil ning sulle avaneb loetelu kursustest.</p>
<br>
<p>Ka tantsukaaslaste leidmine on imelihtne. Kirjuta sulle sobiva<br>
kursuse kommentaaridesse oma kaaslaseotsingust ning jää<br>
ootama vastust. Ehk leiad juba homme oma unelmate partneri?<br>
Kursuste kommenteerimiseks registreeru "Just Dance" kasutajaks.</p>
</div>
</div>
</div>
<section>
<div class="piirkonnad">
<div class="polygon"></div>
<p>Piirkonnad</p>
<div class="sideimage">
<img src="dancers.png" alt="Dancers" id="dancer">
</div>
</div>
<div class="row1">
<img src="1.jpg" alt="Harjumaa" width="170" height="100">
</div>
</section>
</main>
<footer>
<div class="copyright">
<p>Just Dance © Noor Meister Kõik õigused kaitstud</p>
</div>
<div class="social">
</div>
</footer>
</body>
</html>
For make a website responsive you need to avoid px and use %, vw (viewport width) or vh (viewport height).
After in your css you need to declare #media only screen and (max-width: screenSizepx) and inside make the responsive layout for each screen.
Usually i make this with:
#media only screen and (max-width: 1000)
#media only screen and (max-width: 550px)
#media only screen and (max-width: 400px)