Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

my online-store #132

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
9 changes: 0 additions & 9 deletions babel.config.js

This file was deleted.

237 changes: 81 additions & 156 deletions grid/media-query-grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,256 +2,181 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=, initial-scale=1.0">
<meta name="viewport" content="width=100%, initial-scale=1.0">
<title>Grid with media queries</title>
<style>
.container {
width: 100%;
margin-bottom: 30px;

body {
height: 100%;
min-height: 100%;
}

.row {
.container-fluid {
width: 100%;
margin-bottom: 30px;
display: flex;
flex-wrap: wrap;
}

div[class^='col-'] {
.row1 > * {
outline: 1px solid red;
background: lightgray;
text-align: center;
}

.col-1 {
width: calc(100% / 12);
}

.col-2 {
width: calc(100% / 12 * 2);
.row1 {
width: 100%;
display: flex;
flex-wrap: wrap;
}

.col-3 {
width: calc(100% / 12 * 3);
.row {
width: 100%;
height: 700px;
display: flex;
}

.col-4 {
width: calc(100% / 12 * 4);
div[class^='col-sm-4 col-md-4 col-lg-4 col-xl-4'] {
outline: 1px solid red;
text-align: center;
}

.col-5 {
width: calc(100% / 12 * 5);
div[class^='col-xs-12 col-sm-8 col-md-8 col-lg-8 col-xl-8'] {
outline: 1px solid red;
text-align: center;
}

.col-6 {
width: calc(100% / 12 * 6);
@media (max-width:576px) {
.col-sm-4 {
display: none;
}
}

.col-7 {
width: calc(100% / 12 * 7);
.col-4 {
width: calc(100% / 12 * 4);
}

.col-8 {
width: calc(100% / 12 * 8);
}

.col-9 {
width: calc(100% / 12 * 9);
}

.col-10 {
width: calc(100% / 12 * 10);
}

.col-11 {
width: calc(100% / 12 * 11);
width: calc(100% / 12 * 8);
}

.col-12 {
width: calc(100% / 12 * 12);
width: calc(100% / 12 * 12);
}

/* s */
@media (min-width: 576px) {
.col-s-1 {
width: calc(100% / 12 * 1);
}

.col-s-2 {
width: calc(100% / 12 * 2);
}

.col-s-3 {
width: calc(100% / 12 * 3);
}

.col-s-4 {
@media (max-width: 576px) {
.col-xs-4 {
width: calc(100% / 12 * 4);
}

.col-s-5 {
width: calc(100% / 12 * 5);
}

.col-s-6 {
.col-xs-6 {
width: calc(100% / 12 * 6);
}

.col-s-7 {
width: calc(100% / 12 * 7);
}

.col-s-8 {
.col-xs-8 {
width: calc(100% / 12 * 8);
}

.col-s-9 {
width: calc(100% / 12 * 9);
}

.col-s-10 {
width: calc(100% / 12 * 10);
.col-xs-12 {
width: calc(100% / 12 * 12);
}
}

/* m */
@media (min-width: 768px) {
.col-m-1 {
width: calc(100% / 12 * 1);
}

.col-m-2 {
width: calc(100% / 12 * 2);
}

.col-m-3 {
width: calc(100% / 12 * 3);
}

.col-m-4 {
/* sm */
@media (min-width: 576px) and (max-width: 768px) {
.col-sm-4 {
width: calc(100% / 12 * 4);
}

.col-m-5 {
width: calc(100% / 12 * 5);
}

.col-m-6 {
.col-sm-6 {
width: calc(100% / 12 * 6);
}

.col-m-7 {
width: calc(100% / 12 * 7);
}

.col-m-8 {
.col-sm-8 {
width: calc(100% / 12 * 8);
}

.col-m-9 {
width: calc(100% / 12 * 9);
}

.col-m-10 {
width: calc(100% / 12 * 10);
.col-sm-12 {
width: calc(100% / 12 * 12);
}
}

/* l */
@media (min-width: 992px) {
.col-l-1 {
width: calc(100% / 12 * 1);
/* md */
@media (min-width: 768px) and (max-width: 992px) {
.col-md-4 {
width: calc(100% / 12 * 4);
}

.col-l-2 {
width: calc(100% / 12 * 2);
.col-md-6 {
width: calc(100% / 12 * 6);
}

.col-l-3 {
width: calc(100% / 12 * 3);
.col-md-8 {
width: calc(100% / 12 * 8);
}

.col-l-4 {
width: calc(100% / 12 * 4);
.col-md-12 {
width: calc(100% / 12 * 12);
}
}

.col-l-5 {
width: calc(100% / 12 * 5);
/* lg */
@media (min-width: 992px) and (max-width: 1200px) {
.col-lg-4 {
width: calc(100% / 12 * 4);
}

.col-l-6 {
.col-lg-6 {
width: calc(100% / 12 * 6);
}

.col-l-7 {
width: calc(100% / 12 * 7);
}

.col-l-8 {
.col-lg-8 {
width: calc(100% / 12 * 8);
}

.col-l-9 {
width: calc(100% / 12 * 9);
}

.col-l-10 {
width: calc(100% / 12 * 10);
.col-lg-12 {
width: calc(100% / 12 * 12);
}
}

/* xl */
@media (min-width: 1200px) {
.col-xl-1 {
width: calc(100% / 12 * 1);
}

.col-xl-2 {
width: calc(100% / 12 * 2);
}

.col-xl-3 {
width: calc(100% / 12 * 3);
}

.col-xl-4 {
width: calc(100% / 12 * 4);
}

.col-xl-5 {
width: calc(100% / 12 * 5);
}

.col-xl-6 {
width: calc(100% / 12 * 6);
}

.col-xl-7 {
width: calc(100% / 12 * 7);
}

.col-xl-8 {
width: calc(100% / 12 * 8);
}

.col-xl-9 {
width: calc(100% / 12 * 9);
}

.col-xl-10 {
width: calc(100% / 12 * 10);
.col-xl-12 {
width: calc(100% / 12 * 12);
}
}
</style>
</head>
<body>
<main>
<div class="container">
<div class="row">
<div class="col-12 col-s-2 col-m-6 col-l-4 col-xl-10">
col #1
<div class="container-fluid h-100">
<div class="row h-100">
<div class="col-sm-4 col-md-4 col-lg-4 col-xl-4">
Left side
</div>
<div class="col-12 col-s-10 col-m-6 col-l-8 col-xl-2">
col #2
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-8 col-xl-8">
Right side
<div class="row1">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 1</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 2</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 3</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 4</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 5</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 6</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 7</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 8</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">card 9</div>
</div>
</div>
</div>
</div>
Expand Down
Loading