Skip to content

Commit

Permalink
typical-device-breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
gustcustodio committed Jul 11, 2024
1 parent 9e5f2fd commit 4b5e2e8
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
53 changes: 53 additions & 0 deletions exercicios/ex025/mq004/estilos/media-query.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@charset "UTF-8";

/* Todas as demais mídias */

/*
Typical Device Breakpoints
------------------------------
Pequenas telas: até 600px
Celular: de 600px até 768px
Tablet: de 768px até 992px
Desktop: de 992px até 1200px
Grandes telas: acima de 1200px
*/

@media print { /* Impressora */

}

@media screen and (min-width: 768px) and (max-width: 992px) { /* Tablet */
body {
background-image: url(../imagens/back-tablet.jpg);
}

img#phone { display: none; }
img#tablet { display: block; }
img#print { display: none; }
img#pc { display: none; }
img#tv { display: none; }
}

@media screen and (min-width: 992px) and (max-width: 1200px) { /* Desktop */
body {
background-image: url(../imagens/back-pc.jpg);
}

img#phone { display: none; }
img#tablet { display: none; }
img#print { display: none; }
img#pc { display: block; }
img#tv { display: none; }
}

@media screen and (min-width: 1200px) { /* Grandes Telas */
body {
background-image: url(../imagens/back-tv.jpg);
}

img#phone { display: none; }
img#tablet { display: none; }
img#print { display: none; }
img#pc { display: none; }
img#tv { display: block; }
}
48 changes: 48 additions & 0 deletions exercicios/ex025/mq004/estilos/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@charset "UTF-8";

/* Versão Mobile First */

* {
font-family: Arial, Helvetica, sans-serif;
font-size: 1em;
margin: 0px;
padding: 0px;
box-sizing: border-box;
}

html {
height: 100vh;
}

body {
background: black url(../imagens/back-phone.jpg) no-repeat;
background-size: cover;
background-position: center center;
}

main {
background-color: rgba(255, 255, 255, 0.685);
width: 80vw;
margin: auto;
margin-top: 20px;
border-radius: 10px;
padding: 10px;
}

h1 {
text-align: center;
color: white;
font-size: 2em;
text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}

img {
display: block;
margin: auto;
}

img#phone { display: block; }
img#tablet { display: none; }
img#print { display: none; }
img#pc { display: none; }
img#tv { display: none; }
11 changes: 10 additions & 1 deletion exercicios/ex025/mq004/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Media Query</title>
<link rel="stylesheet" href="estilos/style.css" media="all">
<link rel="stylesheet" href="estilos/media-query.css">
</head>
<body>

<main>
<h1>Testando Media Queries</h1>
<img id="phone" src="imagens/icon-phone.png" alt="Acessando via smartphone">
<img id="tablet" src="imagens/icon-tablet.png" alt="Acessando via tablet">
<img id="print" src="imagens/icon-print.png" alt="Versão para impressão">
<img id="pc" src="imagens/icon-pc.png" alt="Versão para desktop">
<img id="tv" src="imagens/icon-tv.png" alt="Versão para TV">
</main>
</body>
</html>

0 comments on commit 4b5e2e8

Please sign in to comment.